|
|
|
@ -1,22 +1,45 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="w-[41.75vh] h-[40.09vh] bgBottomRightBox mt-[2.68vh] relative" v-loading="isLoading">
|
|
|
|
<div
|
|
|
|
<div class="w-[20.8vh] h-[5.07vh] ml-[1.85vh] flex justify-between items-center">
|
|
|
|
class="w-[41.75vh] h-[40.09vh] bgBottomRightBox mt-[2.68vh] relative"
|
|
|
|
|
|
|
|
v-loading="isLoading"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="w-[20.8vh] h-[5.07vh] ml-[1.85vh] flex justify-between items-center"
|
|
|
|
|
|
|
|
>
|
|
|
|
<img src="@/assets/svg/Monitor/Triangle.svg" />
|
|
|
|
<img src="@/assets/svg/Monitor/Triangle.svg" />
|
|
|
|
<span class="text-[2.03vh] youshe leading-none">科室手术量统计(前五)</span>
|
|
|
|
<span class="text-[2.03vh] youshe leading-none"
|
|
|
|
|
|
|
|
>科室手术量统计(前五)</span
|
|
|
|
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="w-[35.46vh] h-[28.05vh] ml-[2.4vh] my-[3.7vh]" ref="echartsContainer"></div>
|
|
|
|
<div
|
|
|
|
<div class="absolute right-0 top-1/4 w-[3.51vh] h-[12.6vh]" :class="sliderClass">
|
|
|
|
class="w-[35.46vh] h-[28.05vh] ml-[2.4vh] my-[3.7vh]"
|
|
|
|
<div class="h-[6.3vh] leading-[6.3vh] text-center text-[#C0D3E1] cursor-pointer" @click="toWeek">周</div>
|
|
|
|
ref="echartsContainer"
|
|
|
|
<div class="h-[6.3vh] leading-[6.3vh] text-center text-[#C0D3E1] cursor-pointer" @click="toMonth">月</div>
|
|
|
|
></div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="absolute right-0 top-1/4 w-[3.51vh] h-[12.6vh]"
|
|
|
|
|
|
|
|
:class="sliderClass"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="h-[6.3vh] leading-[6.3vh] text-center text-[#C0D3E1] cursor-pointer"
|
|
|
|
|
|
|
|
@click="toWeek"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
周
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="h-[6.3vh] leading-[6.3vh] text-center text-[#C0D3E1] cursor-pointer"
|
|
|
|
|
|
|
|
@click="toMonth"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
月
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import * as echarts from 'echarts';
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
import { GetMonitorOperationDept } from '@/api/monitor';
|
|
|
|
import { GetMonitorOperationDept } from "@/api/monitor";
|
|
|
|
import { fnR } from '@/utils/common';
|
|
|
|
import { fnR } from "@/utils/common";
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
let chartLeft = null;
|
|
|
|
let chartLeft = null;
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
@ -24,53 +47,88 @@ export default {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
chartOptions: {
|
|
|
|
chartOptions: {
|
|
|
|
grid: {
|
|
|
|
grid: {
|
|
|
|
left: '0%',
|
|
|
|
left: "0%",
|
|
|
|
right: '0%',
|
|
|
|
right: "0%",
|
|
|
|
top: '0%',
|
|
|
|
top: "0%",
|
|
|
|
bottom: '10%',
|
|
|
|
bottom: "10%",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
type: "category",
|
|
|
|
data: ['骨科', '心胸外科', '普通外科', '神经外科', '整形外科'],
|
|
|
|
data: ["骨科", "心胸外科", "普通外科", "神经外科", "整形外科"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
yAxis: {
|
|
|
|
type: 'value',
|
|
|
|
type: "value",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
data: [180, 165, 155, 148, 137],
|
|
|
|
data: [180, 165, 155, 148, 137],
|
|
|
|
type: 'bar',
|
|
|
|
type: "bar",
|
|
|
|
barWidth: '10%',
|
|
|
|
barWidth: "10%",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
startDate: dayjs().subtract(7, 'day').format('YYYY-MM-DD'),
|
|
|
|
emptyOptions: {
|
|
|
|
endDate: dayjs().format('YYYY-MM-DD'),
|
|
|
|
title: {
|
|
|
|
|
|
|
|
text: "暂无数据",
|
|
|
|
|
|
|
|
x: "center",
|
|
|
|
|
|
|
|
y: "center",
|
|
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
|
|
color: "#fff",
|
|
|
|
|
|
|
|
fontWeight: "normal",
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
startDate: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
|
|
|
|
|
|
|
|
endDate: dayjs().format("YYYY-MM-DD"),
|
|
|
|
sliderClass: {
|
|
|
|
sliderClass: {
|
|
|
|
bgWeekBox: true,
|
|
|
|
bgWeekBox: true,
|
|
|
|
bgMonthBox: false,
|
|
|
|
bgMonthBox: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
renderTimer: null,
|
|
|
|
renderTimer: null,
|
|
|
|
isLoading: true,
|
|
|
|
isLoading: true,
|
|
|
|
|
|
|
|
getDataList: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
onGetPageData() {
|
|
|
|
onGetPageData() {
|
|
|
|
|
|
|
|
chartLeft.clear(); //先清除图表
|
|
|
|
this.isLoading = true;
|
|
|
|
this.isLoading = true;
|
|
|
|
GetMonitorOperationDept({ startDate: this.startDate, endDate: this.endDate }).then(res => {
|
|
|
|
GetMonitorOperationDept({
|
|
|
|
if (res['data']['length']) {
|
|
|
|
startDate: this.startDate,
|
|
|
|
|
|
|
|
endDate: this.endDate,
|
|
|
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
|
|
|
this.getDataList = res["data"] || [];
|
|
|
|
|
|
|
|
if (this.getDataList.length) {
|
|
|
|
this.chartOptions.xAxis.data = [];
|
|
|
|
this.chartOptions.xAxis.data = [];
|
|
|
|
this.chartOptions.series[0].data = [];
|
|
|
|
this.chartOptions.series[0].data = [];
|
|
|
|
res['data'].forEach(item => {
|
|
|
|
res["data"].forEach((item) => {
|
|
|
|
this.chartOptions.xAxis.data.push(item['deptName']);
|
|
|
|
this.chartOptions.xAxis.data.push(item["deptName"]);
|
|
|
|
this.chartOptions.series[0].data.push(item['deptCount']);
|
|
|
|
this.chartOptions.series[0].data.push(item["deptCount"]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (this.$store.getters.isMock) {
|
|
|
|
if (this.$store.getters.isMock) {
|
|
|
|
this.chartOptions.xAxis.data = ['骨科', '心胸外科', '普通外科', '神经外科', '整形外科'];
|
|
|
|
this.chartOptions.xAxis.data = [
|
|
|
|
this.chartOptions.series[0].data = [fnR(), fnR(), fnR(), fnR(), fnR()].sort((a, b) => {
|
|
|
|
"骨科",
|
|
|
|
|
|
|
|
"心胸外科",
|
|
|
|
|
|
|
|
"普通外科",
|
|
|
|
|
|
|
|
"神经外科",
|
|
|
|
|
|
|
|
"整形外科",
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
this.chartOptions.series[0].data = [
|
|
|
|
|
|
|
|
fnR(),
|
|
|
|
|
|
|
|
fnR(),
|
|
|
|
|
|
|
|
fnR(),
|
|
|
|
|
|
|
|
fnR(),
|
|
|
|
|
|
|
|
fnR(),
|
|
|
|
|
|
|
|
].sort((a, b) => {
|
|
|
|
return b - a;
|
|
|
|
return b - a;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//清空数据
|
|
|
|
|
|
|
|
this.chartOptions.xAxis.data = [];
|
|
|
|
|
|
|
|
this.chartOptions.series[0].data = [];
|
|
|
|
|
|
|
|
chartLeft.setOption(this.emptyOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.isLoading = false;
|
|
|
|
this.isLoading = false;
|
|
|
|
@ -78,21 +136,21 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toWeek() {
|
|
|
|
toWeek() {
|
|
|
|
this.startDate = dayjs().subtract(7, 'day').format('YYYY-MM-DD');
|
|
|
|
this.startDate = dayjs().subtract(7, "day").format("YYYY-MM-DD");
|
|
|
|
this.sliderClass.bgWeekBox = true;
|
|
|
|
this.sliderClass.bgWeekBox = true;
|
|
|
|
this.sliderClass.bgMonthBox = false;
|
|
|
|
this.sliderClass.bgMonthBox = false;
|
|
|
|
this.onGetPageData();
|
|
|
|
this.onGetPageData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toMonth() {
|
|
|
|
toMonth() {
|
|
|
|
this.startDate = dayjs().subtract(30, 'day').format('YYYY-MM-DD');
|
|
|
|
this.startDate = dayjs().subtract(30, "day").format("YYYY-MM-DD");
|
|
|
|
this.sliderClass.bgWeekBox = false;
|
|
|
|
this.sliderClass.bgWeekBox = false;
|
|
|
|
this.sliderClass.bgMonthBox = true;
|
|
|
|
this.sliderClass.bgMonthBox = true;
|
|
|
|
this.onGetPageData();
|
|
|
|
this.onGetPageData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.onGetPageData();
|
|
|
|
|
|
|
|
chartLeft = echarts.init(this.$refs.echartsContainer);
|
|
|
|
chartLeft = echarts.init(this.$refs.echartsContainer);
|
|
|
|
|
|
|
|
this.onGetPageData();
|
|
|
|
chartLeft.setOption(this.chartOptions);
|
|
|
|
chartLeft.setOption(this.chartOptions);
|
|
|
|
this.renderTimer = setInterval(() => {
|
|
|
|
this.renderTimer = setInterval(() => {
|
|
|
|
if (this.sliderClass.bgWeekBox) {
|
|
|
|
if (this.sliderClass.bgWeekBox) {
|
|
|
|
@ -110,18 +168,18 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
.bgBottomRightBox {
|
|
|
|
.bgBottomRightBox {
|
|
|
|
background-image: url('@/assets/svg/Monitor/BottomRight/Box.svg');
|
|
|
|
background-image: url("@/assets/svg/Monitor/BottomRight/Box.svg");
|
|
|
|
background-size: contain;
|
|
|
|
background-size: contain;
|
|
|
|
background-position: center;
|
|
|
|
background-position: center;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.bgWeekBox {
|
|
|
|
.bgWeekBox {
|
|
|
|
background-image: url('@/assets/svg/Monitor/BottomLeft/WeekActive.svg');
|
|
|
|
background-image: url("@/assets/svg/Monitor/BottomLeft/WeekActive.svg");
|
|
|
|
background-size: contain;
|
|
|
|
background-size: contain;
|
|
|
|
background-position: center;
|
|
|
|
background-position: center;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.bgMonthBox {
|
|
|
|
.bgMonthBox {
|
|
|
|
background-image: url('@/assets/svg/Monitor/BottomLeft/MonthActive.svg');
|
|
|
|
background-image: url("@/assets/svg/Monitor/BottomLeft/MonthActive.svg");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|