Browse Source

后台首页

new
1747191978@qq.com 1 year ago
parent
commit
38c4e06e98
  1. 8
      acupuncture-后台/src/layout/components/Navbar.vue
  2. 2
      acupuncture-后台/src/store/modules/settings.js
  3. 739
      acupuncture-后台/src/views/indexCom/JM.vue
  4. 600
      acupuncture-后台/src/views/indexCom/XGZL.vue
  5. 445
      acupuncture-后台/src/views/indexCom/follow.vue
  6. BIN
      acupuncture-后台/src/views/indexCom/image.png
  7. 254
      acupuncture-后台/src/views/indexCom/index.js
  8. 646
      acupuncture-后台/src/views/indexCom/patient.vue
  9. 319
      acupuncture-后台/src/views/indexCom/query.vue

8
acupuncture-后台/src/layout/components/Navbar.vue

@ -15,7 +15,7 @@
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" /> <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu"> <div class="right-menu">
<template v-if="device !== 'mobile'"> <!-- <template v-if="device !== 'mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom"> <el-tooltip content="源码地址" effect="dark" placement="bottom">
@ -31,7 +31,7 @@
<el-tooltip content="布局大小" effect="dark" placement="bottom"> <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
</template> </template> -->
<el-dropdown <el-dropdown
class="avatar-container right-menu-item hover-effect" class="avatar-container right-menu-item hover-effect"
@ -45,9 +45,9 @@
<router-link to="/user/profile"> <router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item> <el-dropdown-item>个人中心</el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item @click.native="setting = true"> <!-- <el-dropdown-item @click.native="setting = true">
<span>布局设置</span> <span>布局设置</span>
</el-dropdown-item> </el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item divided @click.native="logout">
<span>退出登录</span> <span>退出登录</span>
</el-dropdown-item> </el-dropdown-item>

2
acupuncture-后台/src/store/modules/settings.js

@ -13,7 +13,7 @@ const {
const storageSetting = JSON.parse(localStorage.getItem("layout-setting")) || ""; const storageSetting = JSON.parse(localStorage.getItem("layout-setting")) || "";
const state = { const state = {
title: "", title: "",
theme: storageSetting.theme || "#fff", theme: storageSetting.theme || "#5698FF",
sideTheme: storageSetting.sideTheme || sideTheme, sideTheme: storageSetting.sideTheme || sideTheme,
showSettings: showSettings, showSettings: showSettings,
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,

739
acupuncture-后台/src/views/indexCom/JM.vue

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

600
acupuncture-后台/src/views/indexCom/XGZL.vue

@ -1,28 +1,28 @@
<template> <template>
<div> <div>
<div class="app-container"> <div class="app-container">
<div class="dis" style="width: 100%"> <div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px"> <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
<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: #91CC75"></span> <span class="dian" style="background: #c6a268"></span>
中西医结合 中西医结合
</div> </div>
<span class="dian" style="background: #5470C6"></span> <span class="dian" style="background: #d8d8d8"></span>
纯中医 纯中医
</div> </div>
</div> </div>
</div> </div>
<div style="height: 300px" v-loading="loading"> <div style="height: 300px" v-loading="loading">
<div id="healType" style="width: 100%"></div> <div id="healType" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
<!-- <div style="flex: 1; margin-right: 20px"> <!-- <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
<div class="dis title-box"> <div class="dis title-box">
<span class="header-title">病种方法分布</span> <span class="header-title">病种方法分布</span>
@ -45,51 +45,50 @@
</div> </div>
</el-card> </el-card>
</div> --> </div> -->
<div style="flex: 1; margin-right: 20px"> <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
<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: #5C7BD9"></span> <span class="dian" style="background: #c6a268"></span>
治愈 治愈
</div> </div>
<div class="dian-box dis"> <div class="dian-box dis">
<span class="dian" style="background: #91CC75"></span> <span class="dian" style="background: #906c4a"></span>
显效 显效
</div> </div>
<div class="dian-box dis"> <div class="dian-box dis">
<span class="dian" style="background: #FAC858"></span> <span class="dian" style="background: #70483e"></span>
好转 好转
</div> </div>
<div class="dian-box dis"> <div class="dian-box dis">
<span class="dian" style="background: #EE6666"></span> <span class="dian" style="background: #c7bdb1"></span>
无效 无效
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="height: 300px" v-loading="loading"> <div style="height: 300px" v-loading="loading">
<div id="effect" style="width: 100%"></div> <div id="effect" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
<div style="flex: 1"> <div style="flex: 1">
<el-card shadow="always"> <el-card shadow="always">
<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>
</div> </div>
</div> <div style="height: 300px" v-loading="loading">
<div style="height: 300px" v-loading="loading"> <div id="cost" style="width: 100%"></div>
<div id="cost" style="width: 100%"></div> </div>
</div> </el-card>
</el-card> </div>
</div> </div>
</div> </div>
</div> <!-- <div class="app-container">
<!-- <div class="app-container">
<div class="dis" style="width: 100%"> <div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px"> <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
@ -135,252 +134,255 @@
</div> </div>
</div> </div>
</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 { import { zlType } from "@/api/indexCom.js";
zlType import {
} from "@/api/indexCom.js"; healTypeEcharts,
import { diseaseMethodEcharts,
healTypeEcharts, effectEcharts,
diseaseMethodEcharts, costEcharts,
effectEcharts, } from "./index";
costEcharts export default {
} from "./index"; name: "Post",
export default { props: ["title"],
name: "Post", mixins: [resize],
props: ["title"], data() {
mixins: [resize], return {
data() { queryParams: {
return { param: {
queryParams: { startTime: "",
param: { endTime: "",
startTime: "", },
endTime: "", },
}, loading: false,
}, healTypeValue: null, //
loading: false, diseaseMethod: null, //
healTypeValue: null, // effectValue: null, //
diseaseMethod: null, // costValue: null, //
effectValue: null, // effectObj: {
costValue: null, // zy: "治愈", //
effectObj: { xx: "显效", //
"zy": "治愈", // hz: "好转", //
"xx": "显效", // wx: "无效", //
"hz": "好转", // },
"wx": "无效" // };
} },
}; created() {
}, // this.Linepatient();
created() { this.getData();
// this.Linepatient(); },
this.getData(); methods: {
}, statistics(_data, _type) {
methods: { this.initial(_data, _type); //
statistics(_data, _type) { this.loading = true;
this.initial(_data, _type); // this.getData(); //
this.loading = true; },
this.getData(); // //
}, async getData() {
// try {
async getData() { await zlType(this.queryParams).then((res) => {
try { const { bzfffb, bzxwfb, zlfy, zllxtj, zlxwfb } = res.data;
await zlType(this.queryParams).then((res) => { //
const { this.healTypeValue = [
bzfffb, {
bzxwfb, value: zllxtj?.zxyjh || 0,
zlfy, name: "中西医结合",
zllxtj, },
zlxwfb {
} = res.data; value: zllxtj?.czy || 0,
// name: "纯中医",
this.healTypeValue = [{ },
value: zllxtj?.zxyjh || 0, ];
name: "中西医结合", this.handleHealType();
}, //
{ // let diseaseMethod = []
value: zllxtj?.czy || 0, // let index = 0
name: "纯中医", // for(let i in bzfffb){
}, // for(let k in bzfffb[i]){
] // console.log(bzfffb[i][k])
this.handleHealType(); // }
// // index ++
// let diseaseMethod = [] // }
// let index = 0 // this.handleDiseaseMethod()
// for(let i in bzfffb){
// for(let k in bzfffb[i]){
// console.log(bzfffb[i][k])
// }
// index ++
// }
// this.handleDiseaseMethod()
//
this.effectValue = [{
name: '治愈',
value: zlxwfb?.zy || 0
},
{
name: '显效',
value: zlxwfb?.xx || 0
},
{
name: '好转',
value: zlxwfb?.hz || 0
},
{
name: '无效',
value: zlxwfb?.wx || 0
}
]
this.handleEffect()
//
this.costValue = [zlfy.score1, zlfy.score2, zlfy.score3, zlfy.score4, zlfy.score5]
this.handleCost()
this.loading = false;
});
} catch (e) { //
console.log('治疗类型', e) this.effectValue = [
} {
}, name: "治愈",
// value: zlxwfb?.zy || 0,
handleHealType() { },
healTypeEcharts.series[0].data = this.healTypeValue {
this.$nextTick(() => { name: "显效",
var myChart = echarts.init(document.getElementById("healType"), null, { value: zlxwfb?.xx || 0,
height: 300, },
}); {
myChart.setOption(healTypeEcharts, true); name: "好转",
myChart.resize(); value: zlxwfb?.hz || 0,
window.onresize = myChart.resize; },
}); {
}, name: "无效",
// value: zlxwfb?.wx || 0,
handleDiseaseMethod() { },
// diseaseMethodEcharts.series[0].data = this.diseaseMethod ];
this.$nextTick(() => { this.handleEffect();
var myChart = echarts.init(document.getElementById("diseaseMethod"), null, { //
height: 300, this.costValue = [
}); zlfy.score1,
myChart.setOption(diseaseMethodEcharts, true); zlfy.score2,
myChart.resize(); zlfy.score3,
window.onresize = myChart.resize; zlfy.score4,
}); zlfy.score5,
}, ];
// this.handleCost();
handleEffect() { this.loading = false;
effectEcharts.series[0].data = this.effectValue });
this.$nextTick(() => { } catch (e) {
var myChart = echarts.init(document.getElementById("effect"), null, { console.log("治疗类型", e);
height: 300, }
}); },
myChart.setOption(effectEcharts, true); //
myChart.resize(); handleHealType() {
window.onresize = myChart.resize; healTypeEcharts.series[0].data = this.healTypeValue;
}); this.$nextTick(() => {
}, var myChart = echarts.init(document.getElementById("healType"), null, {
// height: 300,
handleCost() { });
costEcharts.series[0].data = this.costValue myChart.setOption(healTypeEcharts, true);
this.$nextTick(() => { myChart.resize();
var myChart = echarts.init(document.getElementById("cost"), null, { window.onresize = myChart.resize;
height: 300, });
}); },
myChart.setOption(costEcharts, true); //
myChart.resize(); handleDiseaseMethod() {
window.onresize = myChart.resize; // diseaseMethodEcharts.series[0].data = this.diseaseMethod
}); this.$nextTick(() => {
}, var myChart = echarts.init(
// document.getElementById("diseaseMethod"),
initial(_data, _type) { null,
_data[0] = this.$moment(_data[0]).format("YYYY-MM-DD"); {
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD"); height: 300,
this.queryParams.param = { }
startTime: _data[0] + " " + "00:00:00", );
endTime: _data[1] + " " + "23:59:59", myChart.setOption(diseaseMethodEcharts, true);
}; myChart.resize();
}, window.onresize = myChart.resize;
// });
getRenew() { },
this.handleHealType(); //
this.handleEffect(); handleEffect() {
this.handleCost() effectEcharts.series[0].data = this.effectValue;
}, this.$nextTick(() => {
}, var myChart = echarts.init(document.getElementById("effect"), null, {
}; height: 300,
});
myChart.setOption(effectEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
//
handleCost() {
costEcharts.series[0].data = this.costValue;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("cost"), null, {
height: 300,
});
myChart.setOption(costEcharts, 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",
};
},
//
getRenew() {
this.handleHealType();
this.handleEffect();
this.handleCost();
},
},
};
</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 { .dis {
display: flex; display: flex;
} }
.header-title { .header-title {
font-size: 18px; font-size: 18px;
} }
.title-box { .title-box {
padding: 10px 20px; padding: 10px 20px;
border-bottom: 1px solid #dfe6ec; border-bottom: 1px solid #dfe6ec;
} }
.dian-box { .dian-box {
align-items: center; align-items: center;
} }
.dian { .dian {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
border-radius: 50%; border-radius: 50%;
margin: 0 10px; margin: 0 10px;
} }
.title-box { .title-box {
justify-content: space-between; justify-content: space-between;
} }
.>>>.el-radio--small.is-bordered { . >>> .el-radio--small.is-bordered {
margin-right: 20px !important; margin-right: 20px !important;
margin-left: 0 !important; margin-left: 0 !important;
} }
>>>.el-radio__input { >>> .el-radio__input {
display: none; display: none;
} }
>>>.el-radio__label { >>> .el-radio__label {
padding-left: 5px; padding-left: 5px;
} }
.app-container { .app-container {
padding: 0; padding: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
} }
.title-bor { .title-bor {
display: inline-block; display: inline-block;
height: 20px; height: 20px;
width: 6px; width: 6px;
background: #4f8bff; background: #4f8bff;
margin-right: 10px; margin-right: 10px;
border-radius: 8px; border-radius: 8px;
} }
</style> </style>

445
acupuncture-后台/src/views/indexCom/follow.vue

@ -1,224 +1,261 @@
<template> <template>
<div> <div>
<div class="app-container"> <div class="app-container">
<div class="dis" style="width: 100%"> <div class="dis" style="width: 100%">
<div style="flex: 1;margin-right: 20px;"> <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
<div class="dis title-box"> <div class="dis title-box">
<span class="header-title">随访队列分布</span> <span class="header-title">随访队列分布</span>
<div class="dis"></div> <div class="dis"></div>
</div> </div>
<!-- 患者总数统计图 --> <!-- 患者总数统计图 -->
<div style="height: 300px" v-loading="loading"> <div style="height: 300px" v-loading="loading">
<div id="follow" style="width: 100%"></div> <div id="follow" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
<div style="flex: 1;"> <div style="flex: 1">
<el-card shadow="always"> <el-card shadow="always">
<div class="dis title-box"> <div class="dis title-box">
<span class="header-title">失访原因分布</span> <span class="header-title">失访原因分布</span>
<div class="dis"></div> <div class="dis"></div>
</div> </div>
<!-- 患者总数统计图 --> <!-- 患者总数统计图 -->
<div style="height: 300px" v-loading="loading"> <div style="height: 300px" v-loading="loading">
<div id="lossFollow" style="width: 100%"></div> <div id="lossFollow" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</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 { import { sffb, sftj } from "@/api/indexCom.js";
sffb, import { followEcharts, lossFollowEcharts } from "./index";
sftj export default {
} from "@/api/indexCom.js"; name: "Post",
import { props: ["title"],
followEcharts, mixins: [resize],
lossFollowEcharts data() {
} from "./index"; return {
export default { loading: false,
name: "Post", followValue: [], //
props: ["title"], lossFollowValue: [], //
mixins: [resize], queryParams: {
data() { param: {
return { startTime: "",
loading: false, endTime: "",
followValue: [], // },
lossFollowValue: [], // },
queryParams: { };
param: { },
startTime: "", created() {
endTime: "", // this.Linepatient()
}, this.getData();
}, },
}; methods: {
}, statistics(_data, _type) {
created() { this.initial(_data, _type); //
// this.Linepatient() this.loading = true;
this.getData(); this.getData(); //
}, },
methods: { //
statistics(_data, _type) { async getData() {
this.initial(_data, _type); // try {
this.loading = true; this.followValue = {};
this.getData(); // await sffb(this.queryParams).then((res) => {
}, res.data.forEach((i) => {
// let data = [i.dsf, i.ljsf, i.cqsf, i.zc];
async getData() { this.followValue[i.queueName] = data;
try { });
this.followValue = {} this.handleFollow();
await sffb(this.queryParams).then((res) => { });
res.data.forEach(i => { await sftj(this.queryParams).then((res) => {
let data = [i.dsf, i.ljsf, i.cqsf, i.zc] this.lossFollowValue = res.data;
this.followValue[i.queueName] = data this.handleLossFollow();
}) });
this.handleFollow() this.loading = false;
}); } catch (e) {
await sftj(this.queryParams).then((res) => { console.log("随访", e);
this.lossFollowValue = res.data }
this.handleLossFollow() },
});
this.loading = false;
} catch (e) {
console.log('随访', e)
}
},
// //
handleFollow() { handleFollow() {
followEcharts.series = [] followEcharts.series = [];
for (let key in this.followValue) { let colorArr = [
let series = { "#C7BDB1",
name: key, "#C6A268",
data: this.followValue[key], "#906C4A",
type: "bar", "#70483E",
barMaxWidth: 24, // "#582518",
itemStyle: { "#C7BDB1",
normal: { "#C6A268",
// [] "#906C4A",
barBorderRadius: [50, 50, 0, 0], "#70483E",
}, "#582518",
}, "#C7BDB1",
} "#C6A268",
followEcharts.series.push(series) "#906C4A",
} "#70483E",
this.$nextTick(() => { "#582518",
var myChart = echarts.init(document.getElementById("follow"), null, { "#C7BDB1",
height: 300, "#C6A268",
}); "#906C4A",
myChart.setOption(followEcharts, true); "#70483E",
myChart.resize(); "#582518",
window.onresize = myChart.resize; "#C7BDB1",
}); "#C6A268",
}, "#906C4A",
// 访 "#70483E",
handleLossFollow() { "#582518",
lossFollowEcharts.series[0].data = this.lossFollowValue?.map((item) => { "#C7BDB1",
return item.num; "#C6A268",
}); "#906C4A",
lossFollowEcharts.xAxis.data = this.lossFollowValue?.map((item) => { "#70483E",
return item.reason; "#582518",
}); "#C7BDB1",
this.$nextTick(() => { "#C6A268",
var myChart = echarts.init(document.getElementById("lossFollow"), null, { "#906C4A",
height: 300, "#70483E",
}); "#582518",
myChart.setOption(lossFollowEcharts, true); "#C7BDB1",
myChart.resize(); "#C6A268",
window.onresize = myChart.resize; "#906C4A",
}); "#70483E",
}, "#582518",
// ];
initial(_data, _type) { let index = 0;
_data[0] = this.$moment(_data[0]).format("YYYY-MM-DD"); for (let key in this.followValue) {
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD"); let series = {
this.queryParams.param = { name: key,
startTime: _data[0] + " " + "00:00:00", data: this.followValue[key],
endTime: _data[1] + " " + "23:59:59", type: "bar",
}; barMaxWidth: 24, //
}, color: colorArr[index],
// };
getRenew() { followEcharts.series.push(series);
this.handleFollow(); index++;
this.handleLossFollow() }
}, this.$nextTick(() => {
}, var myChart = echarts.init(document.getElementById("follow"), null, {
}; height: 300,
});
myChart.setOption(followEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
// 访
handleLossFollow() {
lossFollowEcharts.series[0].data = this.lossFollowValue?.map((item) => {
return item.num;
});
lossFollowEcharts.xAxis.data = this.lossFollowValue?.map((item) => {
return item.reason;
});
this.$nextTick(() => {
var myChart = echarts.init(
document.getElementById("lossFollow"),
null,
{
height: 300,
}
);
myChart.setOption(lossFollowEcharts, 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",
};
},
//
getRenew() {
this.handleFollow();
this.handleLossFollow();
},
},
};
</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 { .dis {
display: flex; display: flex;
} }
.header-title { .header-title {
font-size: 18px; font-size: 18px;
} }
.title-box { .title-box {
padding: 10px 20px; padding: 10px 20px;
border-bottom: 1px solid #dfe6ec; border-bottom: 1px solid #dfe6ec;
} }
.dian-box { .dian-box {
align-items: center; align-items: center;
} }
.dian { .dian {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
border-radius: 50%; border-radius: 50%;
margin: 0 10px; margin: 0 10px;
} }
.title-box { .title-box {
justify-content: space-between; justify-content: space-between;
} }
.>>>.el-radio--small.is-bordered { . >>> .el-radio--small.is-bordered {
margin-right: 20px !important; margin-right: 20px !important;
margin-left: 0 !important; margin-left: 0 !important;
} }
>>>.el-radio__input { >>> .el-radio__input {
display: none; display: none;
} }
>>>.el-radio__label { >>> .el-radio__label {
padding-left: 5px; padding-left: 5px;
} }
.app-container { .app-container {
padding: 0; padding: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
} }
.title-bor { .title-bor {
display: inline-block; display: inline-block;
height: 20px; height: 20px;
width: 6px; width: 6px;
background: #4f8bff; background: #4f8bff;
margin-right: 10px; margin-right: 10px;
border-radius: 8px; border-radius: 8px;
} }
</style> </style>

BIN
acupuncture-后台/src/views/indexCom/image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

254
acupuncture-后台/src/views/indexCom/index.js

@ -23,7 +23,7 @@ export const HZXX = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
color: ["#4f8bff", "#ffcd6c", "#00d1a1", "#a794fe"], color: ["#C6A268"],
graphic: { graphic: {
type: "text", type: "text",
left: "center", left: "center",
@ -76,7 +76,7 @@ export const gende = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
color: ["#4F8BFF", "#FE4943"], color: ["#70483E", "#C7BDB1"],
series: [ series: [
{ {
type: "pie", type: "pie",
@ -85,14 +85,14 @@ export const gende = {
label: { label: {
show: false, show: false,
position: "center", position: "center",
normal:{ normal: {
show:true, show: true,
position:'inner', position: "inner",
formatter: '{b}:{c}个', formatter: "{b}:{c}个",
textStyle:{ textStyle: {
color:'#fff' color: "#fff",
} },
}, },
}, },
labelLine: { labelLine: {
show: false, show: false,
@ -127,7 +127,7 @@ export const ageEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ["<40岁","41-50岁","51-60岁","61-70岁","71-80岁",">80岁",], data: ["<40岁", "41-50岁", "51-60岁", "61-70岁", "71-80岁", ">80岁"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -153,20 +153,20 @@ export const ageEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#C6A268",
itemStyle: { // itemStyle: {
normal: { // normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0], // barBorderRadius: [50, 50, 0, 0],
color: function (params) // color: function (params) {
{ // var colorList = [
var colorList = ['#FF9966', '#66B3FF', '#99FF99','#FFCC66','#FF6699','#CCCCCC']; // "#C6A268",
return colorList[params.dataIndex] // ];
}, // return colorList[params.dataIndex];
}, // },
}, // },
// },
}, },
], ],
}; };
// 病种分布 // 病种分布
@ -195,7 +195,7 @@ export const diseaseEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ["<40岁","41-50岁","51-60岁","61-70岁","71-80岁",">80岁",], data: ["<40岁", "41-50岁", "51-60岁", "61-70岁", "71-80岁", ">80岁"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -221,15 +221,8 @@ export const diseaseEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#70483E",
itemStyle: {
normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0],
},
},
}, },
], ],
}; };
@ -259,16 +252,15 @@ export const diagnoseEcharts = {
}, },
}, },
xAxis: { xAxis: {
name: "数量( 个 )", name: "数量( 个 )",
type: "value", type: "value",
minInterval: 1, minInterval: 1,
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
type: "dashed", type: "dashed",
}, },
}, },
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -278,8 +270,8 @@ export const diagnoseEcharts = {
containLabel: true, containLabel: true,
}, },
yAxis: { yAxis: {
type: "category", type: "category",
data: [], data: [],
}, },
series: [ series: [
{ {
@ -287,9 +279,8 @@ export const diagnoseEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#906C4A",
}, },
], ],
}; };
// 体系 // 体系
@ -344,15 +335,14 @@ export const systemEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#C6A268",
itemStyle: { // itemStyle: {
normal: { // normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0], // barBorderRadius: [50, 50, 0, 0],
}, // },
}, // },
}, },
], ],
}; };
// 体质 // 体质
@ -407,15 +397,14 @@ export const physiqueEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#70483E",
itemStyle: { // itemStyle: {
normal: { // normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0], // barBorderRadius: [50, 50, 0, 0],
}, // },
}, // },
}, },
], ],
}; };
// 体态 // 体态
@ -441,7 +430,7 @@ export const postureEcharts = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
color: ["#4f8bff", "#ffcd6c", "#00d1a1", "#a794fe","#EE6666"], color: ["#C7BDB1", "#C6A268", "#906C4A", "#70483E", "#582518"],
series: [ series: [
{ {
type: "pie", type: "pie",
@ -450,14 +439,14 @@ export const postureEcharts = {
label: { label: {
show: false, show: false,
position: "center", position: "center",
normal:{ normal: {
show:true, show: true,
position:'inner', position: "inner",
formatter: '{b}:{c}个', formatter: "{b}:{c}个",
textStyle:{ textStyle: {
color:'#fff' color: "#fff",
} },
}, },
}, },
labelLine: { labelLine: {
show: false, show: false,
@ -492,8 +481,7 @@ export const agrypniaEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['0~4分', '5~9分', '10~14分','15~19分','20~27分'], data: ["0~4分", "5~9分", "10~14分", "15~19分", "20~27分"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -519,15 +507,14 @@ export const agrypniaEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#C6A268",
itemStyle: { // itemStyle: {
normal: { // normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0], // barBorderRadius: [50, 50, 0, 0],
}, // },
}, // },
}, },
], ],
}; };
// 焦虑度 // 焦虑度
@ -556,8 +543,7 @@ export const anxietyEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['<8分', '8~20分','21~35分','>35分'], data: ["<8分", "8~20分", "21~35分", ">35分"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -583,15 +569,14 @@ export const anxietyEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#70483E",
itemStyle: { // itemStyle: {
normal: { // normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0], // barBorderRadius: [50, 50, 0, 0],
}, // },
}, // },
}, },
], ],
}; };
// -------- 治疗类型 -------- // -------- 治疗类型 --------
@ -618,7 +603,7 @@ export const healTypeEcharts = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
color: ["#91CC75", "#5470C6"], color: ["#C6A268", "#D8D8D8"],
series: [ series: [
{ {
type: "pie", type: "pie",
@ -627,14 +612,14 @@ export const healTypeEcharts = {
label: { label: {
show: false, show: false,
position: "center", position: "center",
normal:{ normal: {
show:true, show: true,
position:'inner', position: "inner",
formatter: '{b}:{c}个', formatter: "{b}:{c}个",
textStyle:{ textStyle: {
color:'#fff' color: "#fff",
} },
}, },
}, },
labelLine: { labelLine: {
show: false, show: false,
@ -669,8 +654,7 @@ export const diseaseMethodEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['肥胖症', '失眠症','其他'], data: ["肥胖症", "失眠症", "其他"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -693,7 +677,7 @@ export const diseaseMethodEcharts = {
series: [ series: [
{ {
name: "数量1:", name: "数量1:",
data: [1,2], data: [1, 2],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
itemStyle: { itemStyle: {
@ -705,7 +689,7 @@ export const diseaseMethodEcharts = {
}, },
{ {
name: "数量2:", name: "数量2:",
data: [1,3], data: [1, 3],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
itemStyle: { itemStyle: {
@ -740,7 +724,7 @@ export const effectEcharts = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
color: ["#5C7BD9", "#91CC75",'#FAC858','#EE6666'], color: ["#C6A268", "#906C4A", "#70483E", "#C7BDB1"],
series: [ series: [
{ {
type: "pie", type: "pie",
@ -749,14 +733,14 @@ export const effectEcharts = {
label: { label: {
show: false, show: false,
position: "center", position: "center",
normal:{ normal: {
show:true, show: true,
position:'inner', position: "inner",
formatter: '{b}:{c}个', formatter: "{b}:{c}个",
textStyle:{ textStyle: {
color:'#fff' color: "#fff",
} },
}, },
}, },
labelLine: { labelLine: {
show: false, show: false,
@ -765,7 +749,7 @@ export const effectEcharts = {
}, },
], ],
}; };
// 诊疗费 // 诊疗费
export const costEcharts = { export const costEcharts = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
@ -791,7 +775,7 @@ export const costEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['<300元','300 ~ 900元','900 ~ 2000元','2000 ~ 5000元','>5000元'], data: ["<300元", "300 ~ 900元", "900 ~ 2000元", "2000 ~ 5000元", ">5000元"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -817,14 +801,14 @@ export const costEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
itemStyle: { color: "#C6A268",
normal: { // itemStyle: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // normal: {
barBorderRadius: [50, 50, 0, 0], // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
}, // barBorderRadius: [50, 50, 0, 0],
}, // },
// },
}, },
], ],
}; };
// -------- 随访 -------- // -------- 随访 --------
@ -853,7 +837,7 @@ export const followEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['待随访','临近随访','超期随访','正常随访'], data: ["待随访", "临近随访", "超期随访", "正常随访"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -873,9 +857,9 @@ export const followEcharts = {
}, },
}, },
}, },
series: [ series: [],
],
}; };
// 失访原因
export const lossFollowEcharts = { export const lossFollowEcharts = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
@ -901,7 +885,7 @@ export const lossFollowEcharts = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: ['<300元','300 ~ 900元','900 ~ 2000元','2000 ~ 5000元','>5000元'], data: ["<300元", "300 ~ 900元", "900 ~ 2000元", "2000 ~ 5000元", ">5000元"],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -927,13 +911,13 @@ export const lossFollowEcharts = {
data: [], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
itemStyle: { color: "#70483E",
normal: { // itemStyle: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] // normal: {
barBorderRadius: [50, 50, 0, 0], // //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
}, // barBorderRadius: [50, 50, 0, 0],
}, // },
} // },
},
], ],
}; };

646
acupuncture-后台/src/views/indexCom/patient.vue

@ -1,58 +1,78 @@
<template> <template>
<div> <div>
<div class="app-container"> <div class="app-container">
<div class="dis" style="width: 100%"> <div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px"> <div style="flex: 1; margin-right: 20px">
<el-card shadow="always"> <el-card shadow="always">
<div class="dis title-box"> <div class="dis title-box">
<span class="header-title">患者总数</span> <span class="header-title">患者总数</span>
<div class="dis"></div> <div class="dis"></div>
</div> </div>
<!-- 患者总数统计图 --> <!-- 患者总数统计图 -->
<div style="height: 300px" v-loading="loading"> <div
<div id="patienty" style="width: 100%"></div> style="
</div> height: 300px;
</el-card> display: flex;
</div> align-items: center;
<div style="flex: 1;margin-right: 20px"> justify-content: center;
<el-card shadow="always"> "
<div class="dis title-box"> v-loading="loading"
<span class="header-title">性别数量</span> >
<div class="dis"> <div class="div-hz">
<div class="dian-box dis"> <div class="div-hz-icon">
<div class="dian-box dis"> <img src="./image.png" alt="" width="60px" height="60px" />
<span class="dian" style="background: #4f8bff"></span> </div>
<div class="div-hz-num">
</div> <div class="">
<span class="dian" style="background: #fe4943"></span> {{ HZXXvalue[0].value || 0 }}<span></span>
</div>
</div> <div class="hz-num-title">患者总数</div>
</div> </div>
</div> </div>
<!-- 性别统计图 -->
<div style="height: 300px" v-loading="loading"> <!-- <div id="patienty" style="width: 100%"></div> -->
<div id="gender" style="width: 100%"></div> </div>
</div> </el-card>
</el-card> </div>
</div> <div style="flex: 1; margin-right: 20px">
<div style="flex: 1; margin-right: 20px"> <el-card shadow="always">
<el-card shadow="always"> <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> <div class="dian-box dis">
</div> <div class="dian-box dis">
<!-- 患者总数统计图 --> <span class="dian" style="background: #70483e"></span>
<div style="height: 300px" v-loading="loading">
<div id="age" style="width: 100%"></div> </div>
</div> <span class="dian" style="background: #c7bdb1"></span>
</el-card>
</div> </div>
<div style="flex: 1;"> </div>
<el-card shadow="always"> </div>
<div class="dis title-box"> <!-- 性别统计图 -->
<span class="header-title">既往病种分布</span> <div style="height: 300px" v-loading="loading">
<div class="dis"> <div id="gender" style="width: 100%"></div>
<!-- <div class="dian-box dis"> </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="age" 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 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>
@ -60,268 +80,294 @@
<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="disease" style="width: 100%"></div> <div id="disease" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</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 { import { patientTotal, queryByDatePatient } from "@/api/indexCom.js";
patientTotal, import { HZXX, HZXXSJFX, gende, ageEcharts, diseaseEcharts } from "./index";
queryByDatePatient export default {
} from "@/api/indexCom.js"; name: "Post",
import { props: ["title"],
HZXX, mixins: [resize],
HZXXSJFX, data() {
gende, return {
ageEcharts, loading: false,
diseaseEcharts HZXXvalue: null, //
} from "./index"; gendeValue: null, //
export default { ageValue: null, //
name: "Post", diseaseValue: null, //
props: ["title"], queryParams: {
mixins: [resize], param: {
data() { startTime: "",
return { endTime: "",
loading: false, },
HZXXvalue: null, // },
gendeValue: null, // jwbzObj: {
ageValue: null, // gxy: "高血压", //
diseaseValue: null, // nxgb: "脑血管病", //
queryParams: { exzl: "恶性肿瘤", //
param: { gxb: "冠心病", //
startTime: "", jsjb: "精神疾病", //
endTime: "", whsezcky: "胃和十二指肠溃疡", //
}, fpz: "肥胖症", //
}, gzssz: "骨质疏松症", //
jwbzObj: { ycxXtxjb: "遗传性、先天性疾病", //
"gxy": "高血压", // tnb: "糖尿病", //尿
"nxgb": "脑血管病", // mxfxjb: "慢性肺系疾病", //
"exzl": "恶性肿瘤", // gzxz: "高脂血症", //
"gxb": "冠心病", // gzjb: "肝脏疾病", //
"jsjb": "精神疾病", // gmxjb: "过敏性疾病", //
"whsezcky": "胃和十二指肠溃疡", // gjy: "关节炎", //
"fpz": "肥胖症", // tf: "痛风", //
"gzssz": "骨质疏松症", // sySb: "肾炎、肾病", //
"ycxXtxjb": "遗传性、先天性疾病", // other: "其他", //
"tnb": "糖尿病", //尿 },
"mxfxjb": "慢性肺系疾病", // };
"gzxz": "高脂血症", // },
"gzjb": "肝脏疾病", // created() {
"gmxjb": "过敏性疾病", // // this.Linepatient()
"gjy": "关节炎", // this.getData();
"tf": "痛风", // },
"sySb": "肾炎、肾病", // methods: {
"other": "其他" // statistics(_data, _type) {
} this.initial(_data, _type); //
}; this.loading = true;
}, this.getData(); //
created() { },
// this.Linepatient() //
this.getData(); async getData() {
}, try {
methods: { await patientTotal(this.queryParams).then((res) => {
statistics(_data, _type) { //
this.initial(_data, _type); // this.HZXXvalue = [
this.loading = true; {
this.getData(); // value: res.data.totalPatients,
}, name: "患者总数",
// },
async getData() { ];
try { //
await patientTotal(this.queryParams).then((res) => { this.gendeValue = [
// {
this.HZXXvalue = [{ value: res.data.gender.male,
value: res.data.totalPatients, name: "男",
name: "患者总数" },
}, ]; {
// value: res.data.gender.female,
this.gendeValue = [{ name: "女",
value: res.data.gender.male, },
name: "男" ];
}, //
{ let ageValue = res.data.age;
value: res.data.gender.female, this.ageValue = [
name: "女" ageValue.num1,
} ageValue.num2,
]; ageValue.num3,
// ageValue.num4,
let ageValue = res.data.age ageValue.num5,
this.ageValue = [ageValue.num1, ageValue.num2, ageValue.num3, ageValue.num4, ageValue ageValue.num6,
.num5, ageValue.num6 ];
] //
// let diseaseValue = res.data.jwbz;
let diseaseValue = res.data.jwbz this.diseaseValue = [];
this.diseaseValue = [] for (let key in diseaseValue) {
for (let key in diseaseValue) { let data = {
let data = { name: this.jwbzObj[key],
name: this.jwbzObj[key], value: diseaseValue[key] || 0,
value: diseaseValue[key] };
} this.diseaseValue.push(data);
this.diseaseValue.push(data) }
} // this.Linepatient(); //
this.Linepatient(); // this.handleAge(); //
this.handleAge(); // this.columnar(); //
this.columnar(); // this.handleDisease(); //
this.handleDisease(); // });
}); this.loading = false;
this.loading = false; } catch (e) {
} catch (e) { console.log("患者统计", e);
console.log('患者统计', e) }
} },
},
// //
Linepatient() { Linepatient() {
HZXX.title.text = this.HZXXvalue[0].value; HZXX.title.text = this.HZXXvalue[0].value;
HZXX.series[0].data = this.HZXXvalue; HZXX.series[0].data = this.HZXXvalue;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("patienty"), null, { var myChart = echarts.init(document.getElementById("patienty"), null, {
height: 300, height: 300,
}); });
myChart.setOption(HZXX, true); myChart.setOption(HZXX, true);
myChart.resize(); myChart.resize();
window.onresize = myChart.resize; window.onresize = myChart.resize;
}); });
}, },
// //
columnar() { columnar() {
gende.series[0].data = this.gendeValue; gende.series[0].data = this.gendeValue;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("gender"), null, { var myChart = echarts.init(document.getElementById("gender"), null, {
height: 300, height: 300,
}); });
myChart.setOption(gende, true); myChart.setOption(gende, true);
myChart.resize(); myChart.resize();
window.onresize = myChart.resize; window.onresize = myChart.resize;
}); });
}, },
// //
handleAge() { handleAge() {
ageEcharts.series[0].data = this.ageValue ageEcharts.series[0].data = this.ageValue;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("age"), null, { var myChart = echarts.init(document.getElementById("age"), null, {
height: 300, height: 300,
}); });
myChart.setOption(ageEcharts, true); myChart.setOption(ageEcharts, true);
myChart.resize(); myChart.resize();
window.onresize = myChart.resize; window.onresize = myChart.resize;
}); });
}, },
// //
handleDisease() { handleDisease() {
diseaseEcharts.series[0].data = this.diseaseValue?.map((item) => { diseaseEcharts.series[0].data = this.diseaseValue?.map((item) => {
return item.value; return item.value;
}); });
diseaseEcharts.xAxis.data = this.diseaseValue?.map((item) => { diseaseEcharts.xAxis.data = this.diseaseValue?.map((item) => {
return item.name; return item.name;
}); });
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("disease"), null, { var myChart = echarts.init(document.getElementById("disease"), null, {
height: 300, height: 300,
}); });
myChart.setOption(diseaseEcharts, true); myChart.setOption(diseaseEcharts, true);
myChart.resize(); myChart.resize();
window.onresize = 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");
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD"); _data[1] = this.$moment(_data[1]).format("YYYY-MM-DD");
this.queryParams.param = { this.queryParams.param = {
startTime: _data[0] + " " + "00:00:00", startTime: _data[0] + " " + "00:00:00",
endTime: _data[1] + " " + "23:59:59", endTime: _data[1] + " " + "23:59:59",
}; };
}, },
// //
getRenew() { getRenew() {
this.Linepatient(); // this.Linepatient(); //
this.handleAge(); // this.handleAge(); //
this.columnar(); // this.columnar(); //
this.handleDisease(); // this.handleDisease(); //
}, },
}, },
}; };
</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 { .div-hz {
padding: 10px 0 !important; background: #c6a268;
} width: 80%;
height: 70%;
border-radius: 10px;
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 24px;
}
.div-hz-icon {
flex: 1;
}
.div-hz-num {
flex: 1;
font-size: 50px;
color: #ffffff;
text-align: right;
}
.div-hz-num span {
font-size: 24px;
color: #ffffff;
}
.hz-num-title {
font-size: 22px;
color: #ffffff;
}
>>> .el-card__body {
padding: 10px 0 !important;
}
.dis { .dis {
display: flex; display: flex;
} }
.header-title { .header-title {
font-size: 18px; font-size: 18px;
} }
.title-box { .title-box {
padding: 10px 20px; padding: 10px 20px;
border-bottom: 1px solid #dfe6ec; border-bottom: 1px solid #dfe6ec;
} }
.dian-box { .dian-box {
align-items: center; align-items: center;
} }
.dian { .dian {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
height: 16px; height: 16px;
border-radius: 50%; border-radius: 50%;
margin: 0 10px; margin: 0 10px;
} }
.title-box { .title-box {
justify-content: space-between; justify-content: space-between;
} }
.>>>.el-radio--small.is-bordered { . >>> .el-radio--small.is-bordered {
margin-right: 20px !important; margin-right: 20px !important;
margin-left: 0 !important; margin-left: 0 !important;
} }
>>>.el-radio__input { >>> .el-radio__input {
display: none; display: none;
} }
>>>.el-radio__label { >>> .el-radio__label {
padding-left: 5px; padding-left: 5px;
} }
.app-container { .app-container {
padding: 0; padding: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
} }
.title-bor { .title-bor {
display: inline-block; display: inline-block;
height: 20px; height: 20px;
width: 6px; width: 6px;
background: #4f8bff; background: #4f8bff;
margin-right: 10px; margin-right: 10px;
border-radius: 8px; border-radius: 8px;
} }
</style> </style>

319
acupuncture-后台/src/views/indexCom/query.vue

@ -1,12 +1,12 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="title1"> <div class="title1">
<span class="title-bor"></span> <span class="title-bor"></span>
{{ title }} {{ title }}
</div> </div>
<div> <div>
<div> <div>
<!-- <el-radio-group <!-- <el-radio-group
v-model="radioValue" v-model="radioValue"
size="small" size="small"
style="height: 36px" style="height: 36px"
@ -17,158 +17,163 @@
<el-radio label="2" border style="margin: 0 20px 0 0"></el-radio> <el-radio label="2" border style="margin: 0 20px 0 0"></el-radio>
<el-radio label="3" border style="margin: 0 20px 0 0"></el-radio> <el-radio label="3" border style="margin: 0 20px 0 0"></el-radio>
</el-radio-group> --> </el-radio-group> -->
<el-date-picker v-model="pickerValue" type="daterange" align="right" unlink-panels range-separator="" <el-date-picker
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="pickerChage"> v-model="pickerValue"
</el-date-picker> type="daterange"
</div> align="right"
</div> unlink-panels
</div> range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
@change="pickerChage"
>
</el-date-picker>
</div>
</div>
</div>
</template> </template>
<script> <script>
// import { deviceType } from "./index.js"; // import { deviceType } from "./index.js";
// this.$store.commit('headerFun', data) // this.$store.commit('headerFun', data)
export default { export default {
name: "Post", name: "Post",
props: ["title", "type"], props: ["title", "type"],
data() { data() {
return { return {
radioValue: "1", radioValue: "1",
radioTime: [], radioTime: [],
pickerValue: null, pickerValue: null,
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [
text: "最近一周", {
onClick(picker) { text: "最近一周",
const end = new Date(); onClick(picker) {
const start = new Date(); const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); const start = new Date();
picker.$emit("pick", [start, end]); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
}, picker.$emit("pick", [start, end]);
}, },
{ },
text: "最近一个月", {
onClick(picker) { text: "最近一个月",
const end = new Date(); onClick(picker) {
const start = new Date(); const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); const start = new Date();
picker.$emit("pick", [start, end]); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
}, picker.$emit("pick", [start, end]);
}, },
{ },
text: "最近三个月", {
onClick(picker) { text: "最近三个月",
const end = new Date(); onClick(picker) {
const start = new Date(); const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); const start = new Date();
picker.$emit("pick", [start, end]); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
}, picker.$emit("pick", [start, end]);
}, },
], },
}, ],
}; },
}, };
created() { },
console.log(this.pickerValue, 222); created() {
}, console.log(this.pickerValue, 222);
methods: { },
radioChange() { methods: {
const start = new Date(); radioChange() {
const end = new Date(); const start = new Date();
this.timeType = 4; const end = new Date();
if (this.radioValue == 0) { this.timeType = 4;
this.timeType = 4; if (this.radioValue == 0) {
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); this.timeType = 4;
this.radioTime = [start, end]; start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
} this.radioTime = [start, end];
if (this.radioValue == 1) { }
this.timeType = 4; if (this.radioValue == 1) {
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); this.timeType = 4;
this.radioTime = [start, end]; start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
} this.radioTime = [start, end];
if (this.radioValue == 2) { }
this.timeType = 1; if (this.radioValue == 2) {
const now = new Date(); // this.timeType = 1;
const nowYear = now.getFullYear(); // const now = new Date(); //
const nowMonth = now.getMonth(); // const nowYear = now.getFullYear(); //
const nowDay = now.getDate(); // const nowMonth = now.getMonth(); //
const nowDayOfWeek = now.getDay(); // const nowDay = now.getDate(); //
const jd = Math.ceil((nowMonth + 1) / 3); // const nowDayOfWeek = now.getDay(); //
const startDate = new Date(nowYear, (jd - 1) * 3, 1); const jd = Math.ceil((nowMonth + 1) / 3); //
const endDate = new Date(nowYear, jd * 3, 0); const startDate = new Date(nowYear, (jd - 1) * 3, 1);
this.radioTime = [startDate, endDate]; const endDate = new Date(nowYear, jd * 3, 0);
} this.radioTime = [startDate, endDate];
if (this.radioValue == 3) { }
this.timeType = 1; if (this.radioValue == 3) {
end.setTime(start.getTime()); this.timeType = 1;
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365); end.setTime(start.getTime());
this.radioTime = [start, end]; start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
} this.radioTime = [start, end];
this.$emit( }
"radio-change", this.$emit(
this.pickerValue || this.radioTime, "radio-change",
this.type, this.pickerValue || this.radioTime,
this.timeType this.type,
); this.timeType
}, );
pickerChage() { },
if (!this.pickerValue) { pickerChage() {
this.radioChange(); if (!this.pickerValue) {
} this.radioChange();
console.log(this.pickerValue, 111); }
this.radioTime = []; console.log(this.pickerValue, 111);
this.timeType = 4; this.radioTime = [];
if (this.radioValue == 0) { this.timeType = 4;
this.timeType = 4; if (this.radioValue == 0) {
} this.timeType = 4;
if (this.radioValue == 1) { }
this.timeType = 4; if (this.radioValue == 1) {
} this.timeType = 4;
if (this.radioValue == 2) { }
this.timeType = 1; if (this.radioValue == 2) {
} this.timeType = 1;
if (this.radioValue == 3) { }
this.timeType = 1; if (this.radioValue == 3) {
} this.timeType = 1;
this.$emit("picker-change", this.pickerValue, this.type, this.timeType); }
}, this.$emit("picker-change", this.pickerValue, this.type, this.timeType);
}, },
}; },
};
</script> </script>
<style scoped src="@/assets/styles/common.css"></style> <style scoped src="@/assets/styles/common.css"></style>
<style scoped> <style scoped>
.>>>.el-radio--small.is-bordered { . >>> .el-radio--small.is-bordered {
margin-right: 20px !important; margin-right: 20px !important;
margin-left: 0 !important; margin-left: 0 !important;
} }
>>> .el-radio__input {
>>>.el-radio__input { display: none;
display: none; }
} >>> .el-radio__label {
padding-left: 5px;
>>>.el-radio__label { }
padding-left: 5px; .app-container {
} padding: 0;
display: flex;
.app-container { justify-content: space-between;
padding: 0; }
display: flex; .title1 {
justify-content: space-between; display: flex;
} align-items: center;
font-size: 20px;
.title1 { font-weight: 600;
display: flex; }
align-items: center; .title-bor {
font-size: 20px; display: inline-block;
font-weight: 600; height: 20px;
} width: 6px;
background: #4f8bff;
.title-bor { margin-right: 10px;
display: inline-block; border-radius: 8px;
height: 20px; }
width: 6px; </style>
background: #4f8bff;
margin-right: 10px;
border-radius: 8px;
}
</style>

Loading…
Cancel
Save