|
@@ -0,0 +1,446 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <div v-if="shows" id="nav" class="nav" :class="{ 'fix-nav': navBarFixed }">
|
|
|
|
+ <van-nav-bar
|
|
|
|
+ title="疫苗接种"
|
|
|
|
+ left-arrow
|
|
|
|
+ left-text="返回"
|
|
|
|
+ @click-left="onClickLeft"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="contents">
|
|
|
|
+ <div
|
|
|
|
+ id="main"
|
|
|
|
+ style="
|
|
|
|
+ width: 350px;
|
|
|
|
+ height: 350px;
|
|
|
|
+ margin: 12px auto;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ "
|
|
|
|
+ ></div>
|
|
|
|
+ <div class="contents_p">
|
|
|
|
+ <p>总人数</p>
|
|
|
|
+ <p>{{ total_number }} 人</p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="contents_table">
|
|
|
|
+ <h3>疫苗接种明细</h3>
|
|
|
|
+ <!-- <table border="1" class="tables">
|
|
|
|
+ <tbody class="tbody">
|
|
|
|
+ <tr>
|
|
|
|
+ <th>部门名称</th>
|
|
|
|
+ <th>总人数</th>
|
|
|
|
+ <th>接种第二剂</th>
|
|
|
|
+ <th>接种第一剂</th>
|
|
|
|
+ <th>未接种人数</th>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-for="item in bumen" :key="item.id">
|
|
|
|
+ <th>{{ item.section_fullname }}</th>
|
|
|
|
+ <th>{{ item.section_total_number }} 人</th>
|
|
|
|
+ <th>{{ item.section_total_vaccination_second }} 人</th>
|
|
|
|
+ <th @click="diyiji(item.section_fullname)">
|
|
|
|
+ {{ item.section_total_vaccination_first }} 人
|
|
|
|
+ </th>
|
|
|
|
+ <th @click="weijiezhong(item.section_fullname)">
|
|
|
|
+ {{ item.num }} 人
|
|
|
|
+ </th>
|
|
|
|
+ </tr>
|
|
|
|
+ </tbody>
|
|
|
|
+ </table> -->
|
|
|
|
+
|
|
|
|
+ <div class="list">
|
|
|
|
+ <div class="item" style="border-bottom:2px solid #009FE8;">
|
|
|
|
+ <div class="fullname">部门名称</div>
|
|
|
|
+ <div class="total_number">总人数</div>
|
|
|
|
+ <div class="total_vaccination_second" style="color:#000;">接种 第二剂</div>
|
|
|
|
+ <div class="total_vaccination_first" style="color:#000;">接种 第一剂</div>
|
|
|
|
+ <div class="num" style="color:#000;">未接种</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="item" v-for="item in bumen" :key="item.id">
|
|
|
|
+ <div class="fullname">{{ item.section_fullname }}</div>
|
|
|
|
+ <div class="total_number">{{ item.section_total_number }} 人</div>
|
|
|
|
+ <div class="total_vaccination_second">{{ item.section_total_vaccination_second }} 人</div>
|
|
|
|
+ <div class="total_vaccination_first" @click="diyiji(item.section_fullname)">{{ item.section_total_vaccination_first }} 人</div>
|
|
|
|
+ <div class="num" @click="weijiezhong(item.section_fullname)">{{ item.num }} 人</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div
|
|
|
|
+ id="main2"
|
|
|
|
+ style="width: 350px; height: 540px; margin: 20px auto"
|
|
|
|
+ v-show="shows1 != infos1"
|
|
|
|
+ >
|
|
|
|
+ </div> -->
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { getAllUrlParams } from "../../../plugins/url-encapsulation.js";
|
|
|
|
+import * as echarts from "echarts";
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ shows: false,
|
|
|
|
+ infos: [],
|
|
|
|
+ infos1: [],
|
|
|
|
+ shows1: "",
|
|
|
|
+ navBarFixed: false,
|
|
|
|
+ bumen: [],
|
|
|
|
+ total_number: "", //总人数
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ getanalysis() {
|
|
|
|
+ let myChart = echarts.init(document.getElementById("main"));
|
|
|
|
+ this.$http
|
|
|
|
+ .post(
|
|
|
|
+ "http://ningdongyunying.nxjiewei.com:8011/api/workbench/epidemic_situation/vaccination_statistics"
|
|
|
|
+ )
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ // 指定图表的配置项和数据
|
|
|
|
+ this.infos = res.data.data;
|
|
|
|
+ // console.log(this.infos);
|
|
|
|
+ var option = {
|
|
|
|
+ backgroundColor: "#fff",
|
|
|
|
+ borderRadius: [20, 20, 20, 20],
|
|
|
|
+ title: {
|
|
|
|
+ text: "疫苗接种统计",
|
|
|
|
+ // left: "left",
|
|
|
|
+ x: "25px",
|
|
|
|
+ y: "15px",
|
|
|
|
+ },
|
|
|
|
+ tooltip: {
|
|
|
|
+ show: true,
|
|
|
|
+ trigger: "item",
|
|
|
|
+ // formatter: "{a} <br/>{b} : {c}",
|
|
|
|
+ // textStyle: {
|
|
|
|
+ // fontSize: 10,
|
|
|
|
+ // color: "#fff",
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ legend: {
|
|
|
|
+ //设置小块标记
|
|
|
|
+ // selectedMode:false,
|
|
|
|
+ y: "305px",
|
|
|
|
+ x: "center",
|
|
|
|
+ formatter: function (name) {
|
|
|
|
+ var data = option.series[0].data;
|
|
|
|
+ var total = 0;
|
|
|
|
+ var tarValue;
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ total += data[i].value;
|
|
|
|
+ if (data[i].name == name) {
|
|
|
|
+ tarValue = data[i].value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var v = tarValue;
|
|
|
|
+ // var p = Math.round(((tarValue / total) * 100));
|
|
|
|
+ return `${name} (${v}人)`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ calculable: true,
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ // name: "",
|
|
|
|
+ // type: "pie",
|
|
|
|
+ // radius: ["50%", "80%"], //饼图的半径大小
|
|
|
|
+ // // center: ["60%", "60%"], //饼图的位置
|
|
|
|
+ // label: {
|
|
|
|
+ // //饼图图形上的文本颜色设置
|
|
|
|
+ // normal: {
|
|
|
|
+ // show: true,
|
|
|
|
+ // position: "inner", //标签的位置
|
|
|
|
+ // textStyle: {
|
|
|
|
+ // fontWeight: 300,
|
|
|
|
+ // fontSize: 16, //文字的字体大小
|
|
|
|
+ // },
|
|
|
|
+ // formatter: "{d}%", //设置百分比
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ name: "",
|
|
|
|
+ type: "pie",
|
|
|
|
+ radius: ["40%", "70%"],
|
|
|
|
+ avoidLabelOverlap: false,
|
|
|
|
+ label: {
|
|
|
|
+ show: false,
|
|
|
|
+ position: "center",
|
|
|
|
+ normal: {
|
|
|
|
+ show: true,
|
|
|
|
+ position: "inner", //标签的位置
|
|
|
|
+ textStyle: {
|
|
|
|
+ fontWeight: 100,
|
|
|
|
+ fontSize: 14, //文字的字体大小
|
|
|
|
+ color: "#fff",
|
|
|
|
+ },
|
|
|
|
+ formatter: "{d}%", //设置百分比
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ emphasis: {
|
|
|
|
+ label: {
|
|
|
|
+ show: true,
|
|
|
|
+ fontSize: "20",
|
|
|
|
+ fontWeight: "bold",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ labelLine: {
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ value: this.infos.vaccination_first,
|
|
|
|
+ name: "接种第一剂",
|
|
|
|
+ // 配置映射图显示颜色
|
|
|
|
+ itemStyle: {
|
|
|
|
+ // 设置扇形的颜色
|
|
|
|
+ color: "#39f",
|
|
|
|
+ shadowBlur: 200,
|
|
|
|
+ shadowColor: "rgba(0, 0, 0, 0)",
|
|
|
|
+ },
|
|
|
|
+ }, //饼图图形颜色
|
|
|
|
+ {
|
|
|
|
+ value: this.infos.vaccination_second,
|
|
|
|
+ name: "接种第二剂",
|
|
|
|
+ // 配置映射图显示颜色
|
|
|
|
+ itemStyle: {
|
|
|
|
+ // 设置扇形的颜色
|
|
|
|
+ color: "#9ad12e",
|
|
|
|
+ shadowBlur: 200,
|
|
|
|
+ shadowColor: "rgba(0, 0, 0, 0)",
|
|
|
|
+ },
|
|
|
|
+ }, //饼图图形颜色
|
|
|
|
+ {
|
|
|
|
+ value: this.infos.not_vaccination,
|
|
|
|
+ name: "未接种疫苗",
|
|
|
|
+ Id: "2",
|
|
|
|
+ itemStyle: {
|
|
|
|
+ // 设置扇形的颜色
|
|
|
|
+ color: "red",
|
|
|
|
+ shadowBlur: 200,
|
|
|
|
+ shadowColor: "rgba(0, 0, 0, 0.5)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ myChart.setOption(option);
|
|
|
|
+ myChart.on("legendselectchanged", function (params) {
|
|
|
|
+ // console.log("111");
|
|
|
|
+ // console.log(param.data);
|
|
|
|
+ // let id=param.data.Id
|
|
|
|
+ // console.log(params.name);
|
|
|
|
+ if (params.name == "未接种疫苗") {
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-weijiezhong`;
|
|
|
|
+ }
|
|
|
|
+ if (params.name == "接种第一剂") {
|
|
|
|
+ // console.log("sss");
|
|
|
|
+ let itsname = params.name;
|
|
|
|
+ // console.log(itsname);
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-diyiji?itsname=${itsname}`;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ myChart.on("click", function (param) {
|
|
|
|
+ console.log(param.data.name);
|
|
|
|
+ if (param.data.name == "未接种疫苗") {
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-weijiezhong`;
|
|
|
|
+ }
|
|
|
|
+ if (param.data.name == "接种第一剂") {
|
|
|
|
+ // console.log("sss");
|
|
|
|
+ let itsname = param.data.name;
|
|
|
|
+ // console.log(itsname);
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-diyiji?itsname=${itsname}`;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //获取各部门未接种人员信息,接种第一剂信息,接种第二剂信息
|
|
|
|
+ getbumen() {
|
|
|
|
+ this.$http
|
|
|
|
+ .post(
|
|
|
|
+ "http://ningdongyunying.nxjiewei.com:8011/api/workbench/epidemic_situation/vaccination_statistics"
|
|
|
|
+ )
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ this.total_number = res.data.data.total_number;
|
|
|
|
+ this.bumen = res.data.data.not_nat_section_list;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //各部门未接种人员详情跳转
|
|
|
|
+ weijiezhong(name) {
|
|
|
|
+ // console.log(name);
|
|
|
|
+ let its = name;
|
|
|
|
+ // console.log(its);
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-bumen?its=${its}`;
|
|
|
|
+ },
|
|
|
|
+ //各部门第二剂未接种人员详情跳转
|
|
|
|
+ diyiji(name) {
|
|
|
|
+ // console.log(name);
|
|
|
|
+ let itsname = name;
|
|
|
|
+ window.location.href = `#/ningdongyunying/yiqing/yiqing-bumenone?itsname=${itsname}`;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //吸顶处理
|
|
|
|
+ watchScroll() {
|
|
|
|
+ // 滚动的距离
|
|
|
|
+ var scrollTop =
|
|
|
|
+ window.pageYOffset ||
|
|
|
|
+ document.documentElement.scrollTop ||
|
|
|
|
+ document.body.scrollTop;
|
|
|
|
+
|
|
|
|
+ // 容器的高度
|
|
|
|
+ var offsetTop = document.querySelector("#nav").offsetHeight;
|
|
|
|
+
|
|
|
|
+ console.log("scrollTop=>", scrollTop, " offsetTop=>", offsetTop);
|
|
|
|
+
|
|
|
|
+ // 滚动的距离如果大于了元素到顶部的距离时,实现吸顶效果
|
|
|
|
+ if (scrollTop > offsetTop) {
|
|
|
|
+ this.navBarFixed = true;
|
|
|
|
+ } else {
|
|
|
|
+ this.navBarFixed = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //返回按钮
|
|
|
|
+ onClickLeft() {
|
|
|
|
+ window.history.back();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ document.body.style.backgroundColor = "#39f"; //背景色
|
|
|
|
+ document.body.style.borderRadius = "20px";
|
|
|
|
+ window.addEventListener("scroll", this.watchScroll);
|
|
|
|
+ this.token = getAllUrlParams(window.location.href).token;
|
|
|
|
+ this.tabbar = Boolean(getAllUrlParams(window.location.href).tabbar);
|
|
|
|
+ this.shows = this.tabbar;
|
|
|
|
+ // console.log(this.token);
|
|
|
|
+ this.getanalysis();
|
|
|
|
+ // this.getanalysis1();//各部门疫苗未接种环状图
|
|
|
|
+ this.getbumen();
|
|
|
|
+ },
|
|
|
|
+ destroyed() {
|
|
|
|
+ // 移除事件监听
|
|
|
|
+ window.removeEventListener("scroll", this.watchScroll);
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+>>> .van-nav-bar {
|
|
|
|
+ background: #39f;
|
|
|
|
+}
|
|
|
|
+>>> .van-nav-bar__title {
|
|
|
|
+ color: #fff;
|
|
|
|
+}
|
|
|
|
+>>> .van-nav-bar .van-icon {
|
|
|
|
+ color: #fff;
|
|
|
|
+}
|
|
|
|
+>>> .van-nav-bar__text {
|
|
|
|
+ color: #fff;
|
|
|
|
+}
|
|
|
|
+[class*="van-hairline"]:after {
|
|
|
|
+ border: none;
|
|
|
|
+}
|
|
|
|
+element.style {
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+}
|
|
|
|
+>>> #zr_0 {
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+}
|
|
|
|
+>>> canvas {
|
|
|
|
+ border-radius: 20px !important;
|
|
|
|
+}
|
|
|
|
+.nav {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 30px;
|
|
|
|
+ background-color: #666666;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.fix-nav {
|
|
|
|
+ position: fixed;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 999;
|
|
|
|
+}
|
|
|
|
+.contents {
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+.contents_p {
|
|
|
|
+ text-align: center;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 152px;
|
|
|
|
+ left: 43%;
|
|
|
|
+}
|
|
|
|
+.contents_table {
|
|
|
|
+ width: 350px;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ background: #fff;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
+}
|
|
|
|
+.contents_table > h3 {
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-top: 5px;
|
|
|
|
+ padding-top: 10px;
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
+}
|
|
|
|
+.tables {
|
|
|
|
+ width: 95%;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ border-collapse: collapse;
|
|
|
|
+}
|
|
|
|
+.tbody {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+}
|
|
|
|
+th {
|
|
|
|
+ width: 20%;
|
|
|
|
+ height: 35px;
|
|
|
|
+ border: 3px solid #39f;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.list{
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+}
|
|
|
|
+.list .item{
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 5px 0;
|
|
|
|
+}
|
|
|
|
+.list .item:nth-child(2n){
|
|
|
|
+ background-color: #f0f0f0;
|
|
|
|
+}
|
|
|
|
+.list .item .fullname{
|
|
|
|
+ width: 56px;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.list .item .total_number{
|
|
|
|
+ width: 40px;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.list .item .total_vaccination_second{
|
|
|
|
+ width: 40px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #008c8c;
|
|
|
|
+}
|
|
|
|
+.list .item .total_vaccination_first{
|
|
|
|
+ width: 40px;
|
|
|
|
+ color: #FF8855;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.list .item .num{
|
|
|
|
+ width: 40px;
|
|
|
|
+ color: #FC4850;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</style>
|