This commit is contained in:
闫晓茹 2024-08-14 14:29:47 +08:00
parent 620776519a
commit cbebad7c04
2 changed files with 109 additions and 108 deletions

View File

@ -8,4 +8,11 @@ export function topStatistics(query) {
method: 'get',
params: query
})
}
}
export function signPatientCount(query) {
return request({
url: '/system/homePage/signPatientCount',
method: 'get',
params: query
})
}

View File

@ -56,7 +56,7 @@
</div>
<div class="appbottom">
<div class="appbottomone">
<div class="word">随访覆盖情况</div>
<div class="word">本月签约患者情况</div>
<div id="main1" style="height: 80%"></div>
</div>
<div class="appbottomtwo">
@ -68,7 +68,7 @@
</template>
<script>
import { topStatistics } from "@/api/system/index";
import { topStatistics, signPatientCount } from "@/api/system/index";
import * as echarts from "echarts";
export default {
@ -86,16 +86,14 @@ export default {
this.getlist();
},
methods: {
goback(){
goback() {
this.$router.push({
path: "/task/manualReview",
});
},
gofollowup(){
gofollowup() {
this.$router.push({
path: "/task/followup",
});
},
//
@ -105,110 +103,108 @@ export default {
this.list = res.data;
});
},
goTarget(href) {
window.open(href, "_blank");
},
getlist() {
// domecharts
var chartDoms = document.getElementById("main1");
var myChart1 = echarts.init(chartDoms);
var optionone;
optionone = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
},
// toolbox: {
// feature: {
// dataView: { show: true, readOnly: false },
// magicType: { show: true, type: ["line", "bar"] },
// restore: { show: true },
// // saveAsImage: { show: true },
// },
// },
legend: {
data: ["Evaporation", "Precipitation", "Temperature"],
},
color: ["#91ED93", "#68B4FF"],
xAxis: [
{
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
signPatientCount().then((res) => {
console.log(res, "res");
var countydata = [];
res.data.forEach((e) => {
countydata.push(e.time);
});
var countydatay = [];
res.data.forEach((e) => {
countydatay.push(e.signPatientCount);
});
var proportionlist = [];
res.data.forEach((e) => {
proportionlist.push(e.proportion);
});
// return
var chartDoms = document.getElementById("main1");
var myChart1 = echarts.init(chartDoms);
var optionone;
optionone = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
type: "value",
name: "Precipitation",
min: 0,
max: 250,
interval: 50,
axisLabel: {
formatter: "{value} ml",
},
},
{
type: "value",
name: "Temperature",
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: "{value} °C",
},
},
],
series: [
{
name: "Evaporation",
type: "bar",
tooltip: {
valueFormatter: function (value) {
return value + " ml";
type: "cross",
crossStyle: {
color: "#999",
},
},
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4,
3.3,
],
},
// {
// name: "Precipitation",
// type: "bar",
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
// data: [
// 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0,
// 2.3,
// ],
// },
{
name: "Temperature",
type: "line",
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + " °C";
legend: {
data: ["签约数量", "签约率(%)"],
},
color: ["#2BBD2E", "#68B4FF"],
xAxis: [
{
axisLabel: {
interval: 0,
// show: true,
// rotate: 35,//35
textStyle: {
color: "#000",
fontSize: 12,
},
},
type: "category",
data: countydata,
axisPointer: {
type: "shadow",
},
},
data: [
2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
],
},
],
};
optionone && myChart1.setOption(optionone);
],
yAxis: [
{
type: "value",
name: "签约数量",
// min: 0,
// max: 20,
// interval: 4,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "签约率(%)",
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: "{value}%",
},
},
],
series: [
{
name: "签约数量",
type: "bar",
tooltip: {
valueFormatter: function (value) {
return value + " ml";
},
},
data: countydatay,
barWidth: "20%",
},
{
name: "签约率(%)",
type: "line",
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + " %";
},
},
data: proportionlist,
},
],
};
optionone && myChart1.setOption(optionone);
});
},
info() {
var chartDom = document.getElementById("main");
@ -251,12 +247,10 @@ export default {
<style scoped lang="scss">
.app-container {
background: #f1f3f5;
// display: flex;
width: 100%;
// height: 100%;
padding: 20px 20px 20px 20px;
}
.app {
// width: 99%;
height: 150px;
display: flex;
@ -323,10 +317,10 @@ export default {
}
}
.appright {
width: 16%;
width: 17%;
background: #fff;
border-radius: 5px;
height: calc(100vh - 400px);
height: calc(100vh - 450px);
.wait {
// padding: 20px;
font-weight: 600;