You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.0 KiB

<template>
<div class="w-[71.58vh] h-[40.09vh] bgBottomMidBox mt-[2.68vh] relative">
<div class="flex">
<div class="w-[12.4vh] h-[5.07vh] ml-[1.85vh] flex justify-between items-center">
<img src="@/assets/svg/Monitor/Triangle.svg" />
<span class="text-[2.03vh] youshe leading-none">手术等级</span>
</div>
<div class="w-[12.4vh] h-[5.07vh] ml-[27vh] flex justify-between items-center">
<img src="@/assets/svg/Monitor/Triangle.svg" />
<span class="text-[2.03vh] youshe leading-none">ASA分级</span>
</div>
</div>
<section class="flex mt-[4.81vh]">
<div class="w-[35.79vh] h-[24.62vh] border-r border-dashed border-r-[rgba(255,255,255,0.26)]">
<div class="h-full" ref="echartsContainerLeft"></div>
</div>
<div class="w-[35.79vh] h-[24.62vh]">
<div class="h-full" ref="echartsContainerRight"></div>
</div>
</section>
</div>
</template>
<script>
import * as echarts from 'echarts';
import { GetMonitorOperationLevel, GetMonitorOperationASALevel } from '@/api/monitor';
import { fnR } from '@/utils/common';
import dayjs from 'dayjs';
let chartLeft = null;
let chartRight = null;
export default {
data() {
return {
nowIndex: 0,
chartOptionsLeft: {
series: [
{
type: 'pie',
radius: ['32%', '50%'],
selectedMode: 'single',
data: [
{ name: '一级', value: 148, selected: false },
{ name: '二级', value: 87, selected: false },
{ name: '三级', value: 75, selected: false },
{ name: '四级', value: 40, selected: false },
],
label: {
formatter: '{b}{c}',
color: 'inherit',
},
},
],
},
chartOptionsRight: {
series: [
{
type: 'pie',
radius: ['32%', '50%'],
selectedMode: 'single',
data: [
{ name: 'I级', value: 137, selected: false },
{ name: 'II级', value: 105, selected: false },
{ name: 'III级', value: 58, selected: false },
{ name: 'IV级', value: 37, selected: false },
{ name: 'V级', value: 13, selected: false },
],
label: {
formatter: '{b}{c}',
color: 'inherit',
},
},
],
},
toDate: dayjs().format('YYYY-MM-DD'),
};
},
methods: {
onGetPageData() {
this.isLoading = true;
Promise.all([GetMonitorOperationLevel(this.toDate), GetMonitorOperationASALevel(this.toDate)]).then(res => {
this.chartOptionsLeft.series[0].data[0].value = res[0]['level1'] || fnR();
this.chartOptionsLeft.series[0].data[1].value = res[0]['level2'] || fnR();
this.chartOptionsLeft.series[0].data[2].value = res[0]['level3'] || fnR();
this.chartOptionsLeft.series[0].data[3].value = res[0]['level4'] || fnR();
this.chartOptionsRight.series[0].data[0].value = res[1]['asaLevel1'] || fnR();
this.chartOptionsRight.series[0].data[1].value = res[1]['asaLevel2'] || fnR();
this.chartOptionsRight.series[0].data[2].value = res[1]['asaLevel3'] || fnR();
this.chartOptionsRight.series[0].data[3].value = res[1]['asaLevel4'] || fnR();
this.chartOptionsRight.series[0].data[4].value = res[1]['asaLevel5'] || fnR();
chartLeft.setOption(this.chartOptionsLeft);
chartRight.setOption(this.chartOptionsRight);
this.isLoading = false;
});
},
},
mounted() {
chartLeft = echarts.init(this.$refs.echartsContainerLeft);
chartLeft.setOption(this.chartOptionsLeft);
chartRight = echarts.init(this.$refs.echartsContainerRight);
chartRight.setOption(this.chartOptionsRight);
this.onGetPageData();
},
};
</script>
<style>
.bgBottomMidBox {
background-image: url('@/assets/svg/Monitor/BottomMid/Box.svg');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
</style>