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.

639 lines
17 KiB

2 years ago
<template>
<div class="box" style="height: calc(100% - 41px)">
2 years ago
<div class="top-box">
<div class="topbox-item">
<div class="topbox-item-left">
<div class="topbox-itemleft-img"></div>
<span>不良反应</span>
2 years ago
</div>
2 years ago
<div class="topbox-item-content">
<div class="topbox-itemleft-color">{{ pieData[0].value || 0 }}</div>
2 years ago
<span></span>
</div>
<div class="topbox-item-right">
<div>较去年</div>
<!-- <span class="spanxia"></span> -->
<span class="spanshang"></span>
2 years ago
</div>
</div>
<div class="topbox-item">
<div class="topbox-item-left">
<div class="topbox-itemleft-img"></div>
<span>严重不良反应</span>
</div>
<div class="topbox-item-content">
<div class="topbox-itemleft-color">{{ pieData[1].value || 0 }}</div>
2 years ago
<span></span>
</div>
<div class="topbox-item-right">
<div class="redStyle">较去年</div>
<span class="spanxia"></span>
<!-- <span class="spanshang"></span> -->
2 years ago
</div>
</div>
<div class="topbox-item">
<div class="topbox-item-left">
<div class="topbox-itemleft-img"></div>
<span>发生死亡不良反应</span>
</div>
<div class="topbox-item-content">
<div class="topbox-itemleft-color">{{ pieData[2].value || 0 }}</div>
2 years ago
<span></span>
2 years ago
</div>
2 years ago
<div class="topbox-item-right">
<div class="redStyle">较去年</div>
<span class="spanxia"></span>
<!-- <span class="spanshang"></span> -->
</div>
</div>
</div>
<div class="footers">
<div class="lefts">
<div class="bottom-box" ref="bottom-box"></div>
</div>
<div class="rights">
<div>
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular1"></div>
</div>
<div class="texts">一般不良反应</div>
</div>
<div class="pt-top">
<div class="ptleftbox"></div>
<div class="boxLine"></div>
<div class="ptStyle react1">0%</div>
</div>
</div>
<div>
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular2"></div>
</div>
<div class="texts">严重不良反应</div>
</div>
<div class="pt-top">
<div class="ptleftbox"></div>
<div class="boxLine"></div>
<div class="ptStyle react2">0%</div>
</div>
</div>
<div>
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular3"></div>
</div>
<div class="texts">发生死亡不良反应</div>
</div>
<div class="pt-top">
<div class="ptleftbox"></div>
<div class="boxLine"></div>
<div class="ptStyle react3">0%</div>
</div>
2 years ago
</div>
</div>
2 years ago
</div>
2 years ago
</div>
2 years ago
</template>
<script>
import * as echarts from "echarts";
2 years ago
import {
getCosmeticsBL,
getMedicalDevicesBL,
getDrugBL,
} from "@/api/largeScreen";
2 years ago
export default {
2 years ago
name: "",
components: {},
data() {
return {
option1: {},
// echarts
myChart1: {},
2 years ago
a1: 0,
a2: 0,
a3: 0,
center: ["50%", "50%"],
pieData: [
{
value: 0,
name: "一般不良反应",
},
{
value: 0,
name: "严重不良反应",
},
{
value: 0,
name: "发生死亡不良反应",
},
],
total: 0,
2 years ago
};
},
created() {},
mounted() {
this.getData();
},
methods: {
getData() {
2 years ago
let newRouter = this.$route.query;
if (newRouter.type == 1) {
//药品
2 years ago
getDrugBL({ name: newRouter.code })
.then((res) => {
res.data.result.forEach((value, index) => {
this.pieData.forEach((value1, index1) => {
if (
value.reportType == "一般" &&
value1.name == "一般不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType == "严重" &&
value1.name == "严重不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType != "一般" &&
value.reportType != "严重" &&
value1.name == "发生死亡不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
});
});
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
})
.catch(() => {
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
});
2 years ago
}
if (newRouter.type != 1 && newRouter.type != 2) {
//化妆品
2 years ago
getCosmeticsBL({ name: newRouter.code })
.then((res) => {
res.data.result.forEach((value, index) => {
this.pieData.forEach((value1, index1) => {
if (
value.reportType == "一般" &&
value1.name == "一般不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType == "严重" &&
value1.name == "严重不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType != "一般" &&
value.reportType != "严重" &&
value1.name == "发生死亡不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
});
});
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
})
.catch(() => {
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
2 years ago
});
2 years ago
}
if (newRouter.type == 2) {
//医疗器械
2 years ago
getMedicalDevicesBL({ name: newRouter.code })
.then((res) => {
res.data.result.forEach((value, index) => {
this.pieData.forEach((value1, index1) => {
if (
value.reportType == "严重伤害" &&
value1.name == "严重不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType == "其他" &&
value1.name == "一般不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
if (
value.reportType != "严重伤害" &&
value.reportType != "其他" &&
value1.name == "发生死亡不良反应"
) {
this.pieData[index1].value = value.reportCount;
}
});
});
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
})
.catch(() => {
this.$nextTick(() => {
let chartDom = this.$refs["bottom-box"];
this.myChart1 = echarts.init(chartDom);
this.initEcharts();
});
});
2 years ago
}
2 years ago
},
2 years ago
initEcharts() {
this.option1 = {
tooltip: {
trigger: "item",
formatter: "{b} : {c} ({d}%)",
position: "right",
},
polar: { center: this.center, color: "#0B3A72" },
angleAxis: { center: this.center, color: "#0B3A72" },
radiusAxis: {
color: "#0B3A72",
center: this.center,
min: 10,
max: 70,
interval: 10,
2 years ago
axisLine: {
show: false,
lineStyle: {
color: "#0B3E5E",
width: 1,
type: "solid",
},
},
axisLabel: {
formatter: "{value} %",
show: false,
padding: [0, 0, 20, 0],
color: "#0B3E5E",
fontSize: 16,
},
splitLine: {
lineStyle: {
color: "#0B3E5E",
width: 2,
type: "solid",
},
},
},
calculable: true,
series: [
{
color: "#0B3A72",
center: this.center,
type: "pie",
radius: ["9%", "16%"],
2 years ago
hoverAnimation: false,
tooltip: { show: false },
2 years ago
labelLine: {
normal: {
show: false,
length: 30,
length2: 55,
},
emphasis: {
show: false,
},
},
data: [
{
name: "",
value: 0,
itemStyle: {
normal: {
color: "#fff",
2 years ago
},
2 years ago
},
2 years ago
},
],
},
{
center: this.center,
type: "pie",
radius: ["96%", "95%"],
2 years ago
color: "#0B3A72",
hoverAnimation: false,
labelLine: {
normal: {
show: false,
length: 30,
length2: 55,
},
emphasis: {
show: false,
},
},
name: "",
data: [
{
name: "",
value: 0,
itemStyle: {
normal: {
2 years ago
color: "#0B3A72",
2 years ago
},
2 years ago
},
2 years ago
},
],
},
{
center: this.center,
stack: "a",
type: "pie",
radius: ["26%", "68%"],
2 years ago
roseType: "area",
zlevel: 10,
label: {
normal: {
show: false,
formatter: "",
textStyle: {
fontSize: 12,
},
},
emphasis: {
show: true,
},
},
labelLine: {
normal: {
show: false,
length: 200,
length2: 55,
},
emphasis: {
show: false,
},
},
data: this.pieData,
2 years ago
},
],
};
this.myChart1.setOption(this.option1);
2 years ago
},
2 years ago
},
computed: {},
};
2 years ago
</script>
<style scoped lang='scss'>
.top-box {
2 years ago
.topbox-item {
&:nth-child(1) {
.topbox-itemleft-img {
background: url("../../../assets/images/daping/buliang1.png");
}
.topbox-itemleft-color {
background: linear-gradient(0deg, #ffffff 0%, #0373e0 100%);
}
}
2 years ago
2 years ago
&:nth-child(2) {
.topbox-itemleft-img {
background: url("../../../assets/images/daping/buliang2.png");
}
2 years ago
2 years ago
.topbox-itemleft-color {
background: linear-gradient(0deg, #ffffff 0%, #bf6e35 100%);
}
}
2 years ago
2 years ago
&:nth-child(3) {
.topbox-itemleft-img {
background: url("../../../assets/images/daping/buliang3.png");
}
2 years ago
2 years ago
.topbox-itemleft-color {
background: linear-gradient(0deg, #ffffff 0%, #f04f50 100%);
}
}
2 years ago
2 years ago
display: flex;
align-items: center;
height: 40px;
width: 98%;
background: url("../../../assets/images/daping/toushi.png");
background-size: contain;
background-repeat: no-repeat;
background-position: bottom;
> div {
display: flex;
align-items: center;
}
2 years ago
2 years ago
.topbox-item-left {
margin-left: 20px;
flex: 1.9;
2 years ago
2 years ago
.topbox-itemleft-img {
width: 20px;
height: 20px;
2 years ago
background-size: contain;
background-repeat: no-repeat;
2 years ago
margin-right: 10px;
}
span {
font-size: 14px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #b7d4f5;
// line-height: 50px;
2 years ago
}
}
2 years ago
2 years ago
.topbox-item-content {
flex: 1.5;
.topbox-itemleft-color {
max-width: 110px;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 溢出内容隐藏 */
text-overflow: ellipsis;
/* 显示省略号 */
font-size: 26px;
font-family: YouSheBiaoTiHei;
font-weight: 400;
color: #ffffff;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-right: 5px;
}
span {
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #b7d4f5;
// line-height: 50px;
2 years ago
opacity: 0.5;
}
}
2 years ago
2 years ago
.topbox-item-right {
flex: 1;
.redStyle {
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #ffffff;
2 years ago
background: linear-gradient(0deg, #ffffff 0%, #d21b1b 100%);
2 years ago
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-right: 5px;
}
div {
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #ffffff;
background: linear-gradient(0deg, #ffffff 0%, #26e0c4 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-right: 5px;
}
span {
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
}
.spanshang {
color: #26e0c4;
}
.spanxia {
color: #da1b1b;
}
2 years ago
}
2 years ago
}
2 years ago
}
.footers {
height: calc(100% - 120px);
display: flex;
2 years ago
.lefts {
height: 100%;
width: 50%;
padding: 10px;
.bottom-box {
height: 100%;
width: 100%;
}
}
.rights {
height: 100%;
padding-left: 15px;
width: 50%;
display: flex;
flex-direction: column;
justify-content: space-evenly;
}
}
.pt-top {
display: flex;
align-items: center;
position: relative;
.ptleftbox {
width: 12%;
height: 100%;
.rectangular1 {
height: 8px;
width: 8px;
background: #2e87e8;
}
.rectangular2 {
height: 8px;
width: 8px;
background: #f0a436;
}
.rectangular3 {
height: 8px;
width: 8px;
background: #f35656;
}
}
.texts {
width: 60%;
font-size: 16px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #b7d4f5;
}
.react1 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #2e87e8;
padding-left: 10px;
}
.react2 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #f0a436;
padding-left: 10px;
}
.react3 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
padding-left: 10px;
color: #f35656;
}
.ptStyle {
width: 60%;
margin-top: 5px;
background: linear-gradient(
to right,
rgba(36, 64, 97, 1),
rgba(36, 64, 97, 0)
);
}
.boxLine {
position: absolute;
width: 18px;
height: 20px;
border: 1px solid #0e2339;
border-right: none;
border-top: none;
left: 3px;
top: -5px;
}
2 years ago
}
</style>