WXL
2024-09-07 88d423ce3a1f624bc3b84b4c71ec06d8024da15b
src/views/index.vue
@@ -110,7 +110,6 @@
            <!-- 中间echars -->
            <div class="boxEchars">
              <div class="echars1" id="echars"></div>
              <div class="echars2" id="echars2"></div>
            </div>
          </div>
        </el-col>
@@ -147,27 +146,19 @@
      </el-row>
      <!-- 底部一个 -->
      <el-row :gutter="20" style="margin-bottom: 20px">
        <el-col :span="13">
        <el-col :span="15">
          <div class="grid-content bg-purple" style="min-height: 300px">
            <div class="title">
              诊后统计
              宣教统计
              <span class="el-icon-s-unfold moreIcon"></span>
            </div>
            <div class="cooperate">
              <!-- 合作区域 -->
              <div class="pieChart" id="pieCharts"></div>
              <div class="Points">
                <p>{{ 122 }}</p>
                <span>其中随访干预人次</span>
                <p>{{ 122 }}</p>
                <span>门诊随访</span>
                <p>{{ 122 }}</p>
                <span>出院随访</span>
              </div>
            </div>
          </div>
        </el-col>
        <el-col :span="10">
        <el-col :span="9">
          <div class="grid-content bg-purple" style="min-height: 300px">
            <div class="title">
              各项服务统计
@@ -175,78 +166,118 @@
            </div>
            <div class="empenty">
              <el-row>
                <el-col :span="4"
                  ><div class="grid-content bg-purple">诊疗预约</div></el-col
                <el-col :span="3"
                  ><div class="grid-contents bg-purples">出院:</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">123次</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">转诊服务</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">231次</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">信息推送</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">900次</div></el-col
                > </el-row
              ><el-row>
                <el-col :span="4"
                  ><div class="grid-content bg-purple">标识与导航</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">23次</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">
                    患者便利保障服务
                  </div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">13次</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">远程医疗</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">31次</div></el-col
                > </el-row
              ><el-row>
                <el-col :span="4"
                  ><div class="grid-content bg-purple">患者反馈</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">150人</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">患者管理</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">231人</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">健康宣教</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">400</div></el-col
                >
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">出院随访</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">出院宣教</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">复诊通知</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="4"
                  ><div class="grid-content bg-purple">反馈占比</div></el-col
                <el-col :span="3"
                  ><div class="grid-contents bg-purples"></div
                ></el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">出院评估</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">满意度调查</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">其他通知</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="3"
                  ><div class="grid-contents bg-purples">门诊:</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">23%</div></el-col
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">门诊随访</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">门诊宣教</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">复诊通知</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="3"
                  ><div class="grid-contents bg-purples"></div
                ></el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">满意度调查</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">其他通知</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="3"
                  ><div class="grid-contents bg-purples">在院:</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple">管理占比</div></el-col
                >
                <el-col :span="4"
                  ><div class="grid-content bg-purple-light">32%</div></el-col
                >
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">在院宣教</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">在院评估</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
                <el-col :span="7">
                  <div style="display: flex">
                    <div class="subtitle">其他通知</div>
                    <div class="grid-contents bg-purple-light">0次</div>
                  </div>
                </el-col>
              </el-row>
            </div>
          </div>
@@ -257,17 +288,12 @@
</template>
<script>
// import {
//   getUserWork,
//   getregionCollect,
//   getregionOrderCount,
//   getregionAmountCollect,
//   getNodeCount,
//   getPrtnerCount,
//   getnodeCollect,
//   getSkuTop,
//   getOrderAmount,
// } from "@/api/home";
import {
  getoutpatientamount,
  getInhospital,
  getBarchart,
  getQtemplateobj,
} from "@/api/AiCentre/index";
import dayjs from "dayjs";
export default {
@@ -277,6 +303,10 @@
      NodeCount: "",
      PrtnerCount: "",
      NodeCount: "",
      myChart2: null,
      mypPieCharts: null,
      lastWidth: window.innerWidth,
      lastHeight: window.innerHeight,
      radio1: "周",
      ticketStatistics: {},
      order: "",
@@ -289,6 +319,7 @@
      cylinderSeries: [],
      cylinderXAxis: [],
      dyat: 30,
      intervalId: null,
    };
  },
@@ -308,19 +339,24 @@
    },
  },
  created() {
    // this.getoutpatientamount();
    // this.getInhospital();
    // this.getBarchart();
    this.$nextTick(function () {
      this.getregionAmountCollect();
      this.getUserWorks();
      this.getregionCollect();
      this.getregionOrderCount();
      this.getNodeCount();
      this.getPrtnerCount();
      this.getnodeCollect();
      this.getSkuTop();
      this.getOrderAmount();
    });
  },
  mounted() {},
  mounted() {
    this.setInterval();
    // window.addEventListener("resize", this.handleResize());
  },
  beforeDestroy() {
    if (this.intervalId) {
      clearInterval(this.intervalId); // 清除定时器
    }
  },
  methods: {
    // 改变时间事件
    changes() {
@@ -332,43 +368,13 @@
        this.dyat = 360;
      }
      this.getregionAmountCollect();
      this.getUserWorks();
      this.getregionCollect();
      this.getregionOrderCount();
      this.getNodeCount();
      this.getPrtnerCount();
      // this.getoutpatientamount();
      // this.getInhospital();
      // this.getBarchart();
      this.getnodeCollect();
      this.getSkuTop();
      this.getOrderAmount();
    },
    // 柱状图
    async getOrderAmount() {
      // const res = await getOrderAmount(this.endatd, this.statd);
      // this.cylinderXAxis = res.data.xAxis;
      // this.cylinderSeries = res.data.series;
      this.cylinderXAxis = [
        "1月",
        "2月",
        "3月",
        "4月",
        "5月",
        "6月",
        "7月",
        "8月",
      ];
      this.cylinderSeries = [123, 123, 223, 212, 432, 123, 442, 234];
      this.myEcharts();
    },
    // 获取点位总数
    async getNodeCount() {
      // const res = await getNodeCount();
      // this.NodeCount = res.data;
    },
    // 获取合作商总数
    async getPrtnerCount() {
      // const res = await getPrtnerCount();
      // this.PrtnerCount = res.data;
    },
    // 合作商点位汇总统计饼状图
    async getnodeCollect() {
      // const res = await getnodeCollect();
@@ -398,108 +404,24 @@
        { amount: 0, count: 88, skuId: "0", skuName: "器械科" },
        { amount: 0, count: 87, skuId: "0", skuName: "骨科" },
        { amount: 0, count: 67, skuId: "0", skuName: "放射科" },
      ];
    },
    // 获取工单数量
    async getUserWorks() {
      // const res = await getUserWork(this.atd, this.td);
      // this.ticketStatistics = res.data[0];
    // 获取门诊基础数据
    getoutpatientamount() {
      getoutpatientamount().then((res) => {});
    },
    // 获取就诊数量
    async getregionOrderCount() {
      // const res = await getregionOrderCount({
      //   start: this.atd,
      //   end: this.td,
      // });
      // this.order = res.data;
    getBarchart() {
      getBarchart().then((res) => {});
    },
    // 获取总量数量
    async getregionCollect() {
      // const res = await getregionCollect({
      //   start: this.atd,
      //   end: this.td,
      // });
      // this.Count = (res.data / 1000000).toFixed(2);
    getInhospital() {
      getInhospital().then((res) => {});
    },
    // 柱状图
    myEcharts() {
      // 基于准备好的dom,初始化echarts实例
      var echarts = require("echarts");
      var myChart = echarts.init(document.getElementById("echars2"));
      // 指定图表的配置项和数据
      var option = {
        title: {
          text: "诊中统计",
        },
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["院内推送", "宣教完成"],
        },
        toolbox: {
          show: true,
          feature: {
            dataView: { show: true, readOnly: false },
            magicType: { show: true, type: ["line", "bar"] },
            restore: { show: true },
            saveAsImage: { show: true },
          },
        },
        calculable: true,
        xAxis: [
          {
            type: "category",
            // prettier-ignore
            data: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月"],
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        series: [
          {
            name: "院内推送",
            type: "bar",
            data: [20, 49, 70, 32, 56, 76, 56, 122, 26, 20, 64, 33],
            markPoint: {
              data: [
                { type: "max", name: "Max" },
                { type: "min", name: "Min" },
              ],
            },
            markLine: {
              data: [{ type: "average", name: "Avg" }],
            },
          },
          {
            name: "宣教完成",
            type: "bar",
            data: [26, 59, 90, 64, 87, 70, 75, 182, 87, 82, 60, 23],
            markPoint: {
              data: [
                { name: "Max", value: 182, xAxis: 7, yAxis: 183 },
                { name: "Min", value: 2.3, xAxis: 11, yAxis: 3 },
              ],
            },
            markLine: {
              data: [{ type: "average", name: "Avg" }],
            },
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    },
    // 获取线状图时间
    async getregionAmountCollect() {
      // const res = await getregionAmountCollect(1, this.endatd, this.statd);
      //getregionAmountCollect(1, this.endatd, this.statd);
      // this.xAxis = res.data.xAxis;
      // this.series = res.data.series;
      this.xAxis = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月"];
@@ -510,66 +432,145 @@
    myEcharts2() {
      var echarts = require("echarts");
      var myChart2 = echarts.init(document.getElementById("echars"));
      this.myChart2 = myChart2;
      var option2 = {
        title: {
          text: "诊前数据",
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            crossStyle: {
              color: "#999",
            },
          },
        },
        dataset: {
          source: [
            ["product", "2018", "2019", "2020", "2021", "2022", "2023"],
            ["复诊", 256, 182, 388, 270, 253, 385],
            ["住院", 351, 451, 355, 353, 373, 468],
            ["手术", 440, 362, 569, 436, 445, 332],
            ["转诊", 525, 237, 541, 518, 433, 249],
        toolbox: {
          feature: {
            dataView: { show: true, readOnly: false },
            magicType: { show: true, type: ["line", "bar"] },
            restore: { show: true },
            saveAsImage: { show: true },
          },
        },
        legend: {
          data: [
            "出院随访量",
            "门诊随访量",
            "在院随访量",
            "门诊复诊通知",
            "出院复诊通知",
            "在院评估量",
          ],
        },
        xAxis: { type: "category" },
        yAxis: { gridIndex: 0 },
        grid: { top: "55%" },
        xAxis: [
          {
            type: "category",
            data: [
              "一月",
              "二月",
              "三月",
              "四月",
              "五月",
              "六月",
              "七月",
              "八月",
              "九月",
              "十月",
            ],
            axisPointer: {
              type: "shadow",
            },
          },
        ],
        yAxis: [
          {
            type: "value",
            name: "随访量",
            min: 0,
            max: 250,
            interval: 50,
            axisLabel: {
              formatter: "{value} 人",
            },
          },
          {
            type: "value",
            name: "复诊/评估次数",
            min: 0,
            max: 250,
            interval: 50,
            axisLabel: {
              formatter: "{value} 次",
            },
          },
        ],
        grid: { top: "35%" },
        series: [
          {
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            type: "pie",
            id: "pie",
            radius: "30%",
            center: ["50%", "25%"],
            emphasis: {
              focus: "self",
            name: "出院随访量",
            type: "bar",
            tooltip: {
              valueFormatter: function (value) {
                return value + " 人";
              },
            },
            label: {
              formatter: "{b}: {@2018} ({d}%)",
            data: [120, 150, 165, 90, 140, 200, 130, 85, 175, 95, 110, 160],
          },
          {
            name: "门诊随访量",
            type: "bar",
            tooltip: {
              valueFormatter: function (value) {
                return value + " 人";
              },
            },
            encode: {
              itemName: "product",
              value: "2018",
              tooltip: "2018",
            data: [102, 190, 135, 88, 175, 160, 83, 145, 200, 110, 97, 180],
          },
          {
            name: "在院随访量",
            type: "bar",
            tooltip: {
              valueFormatter: function (value) {
                return value + " 人";
              },
            },
            data: [145, 92, 178, 134, 167, 85, 199, 112, 156, 88, 120, 145],
          },
          {
            name: "出院复诊通知",
            type: "line",
            smooth: 0.3,
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value + " 次";
              },
            },
            data: [45, 123, 78, 156, 89, 34, 199, 112, 67, 145, 88, 175],
          },
          {
            name: "门诊复诊通知",
            type: "line",
            smooth: 0.3,
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value + " 次";
              },
            },
            data: [102, 190, 135, 88, 175, 160, 83, 145, 200, 110, 97, 180],
          },
          {
            name: "在院评估量",
            type: "line",
            smooth: 0.3,
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value + " 次";
              },
            },
            data: [120, 150, 165, 90, 140, 200, 130, 85, 175, 95, 110, 160],
          },
        ],
      };
@@ -581,7 +582,7 @@
            series: {
              id: "pie",
              label: {
                formatter: "{b}: {@[" + dimension + "]} ({d}%)",
                formatter: "{b}: {@[" + dimension + "]} ",
              },
              encode: {
                value: dimension,
@@ -598,59 +599,112 @@
      // 基于准备好的dom,初始化echarts实例
      var echarts = require("echarts");
      var mypPieCharts = echarts.init(document.getElementById("pieCharts"));
      this.mypPieCharts = mypPieCharts;
      // 指定图表的配置项和数据
      var optionPie = {
        // title: {
        //   left: "left",
        // },
        legend: {},
        tooltip: {
          trigger: "item",
          formatter: "{b}<br/>总占比 : {d}% ",
          trigger: "axis",
          showContent: true,
        },
        toolbox: {
          show: true,
          feature: {
            mark: { show: true },
          },
        dataset: {
          source: [
            ["product", "2012", "2013", "2014", "2015", "2016", "2017"],
            ["出院宣教", 56, 82, 88, 70, 53, 85],
            ["在院宣教", 51, 51, 55, 53, 73, 68],
            ["门诊宣教", 40, 62, 69, 36, 45, 32],
          ],
        },
        legend: {
          top: "5%",
          left: "center",
        },
        xAxis: { type: "category" },
        yAxis: { gridIndex: 0 },
        grid: { top: "25%", left: "10%", right: "40%", bottom: "10%" },
        series: [
          {
            name: "Access From",
            name: "出院宣教",
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            name: "在院宣教",
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            name: "门诊宣教",
            type: "line",
            smooth: true,
            seriesLayoutBy: "row",
            emphasis: { focus: "series" },
          },
          {
            type: "pie",
            id: "pie",
            radius: ["40%", "70%"],
            avoidLabelOverlap: false,
            center: ["80%", "50%"],
            emphasis: {
              focus: "self",
            },
            itemStyle: {
              borderRadius: 10,
              borderColor: "#fff",
              borderWidth: 2,
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: "bold",
              },
            label: {
              formatter: "{b}: {@2012}",
            },
            labelLine: {
              show: false,
            encode: {
              itemName: "product",
              value: "2012",
              tooltip: "2012",
            },
            data: [
              { value: 580, name: "门诊随访" },
              { value: 484, name: "出院随访" },
            ],
          },
        ],
      };
      mypPieCharts.on("updateAxisPointer", function (event) {
        const xAxisInfo = event.axesInfo[0];
        if (xAxisInfo) {
          const dimension = xAxisInfo.value + 1;
          mypPieCharts.setOption({
            series: {
              id: "pie",
              label: {
                formatter: "{b}: {@[" + dimension + "]} ",
              },
              encode: {
                value: dimension,
                tooltip: dimension,
              },
            },
          });
        }
      });
      // 使用刚指定的配置项和数据显示图表。
      mypPieCharts.setOption(optionPie);
    },
    // 页面变化调整大小
    handleResize() {
      console.log(111);
      // 调整 ECharts 图表大小
      if (this.myChart2) {
        this.myChart2.resize();
      }
      if (this.mypPieCharts) {
        this.mypPieCharts.resize();
      }
    },
    setInterval() {
      this.intervalId = setInterval(() => {
        if (window.innerWidth != this.lastWidth) {
          this.lastWidth = window.innerWidth;
          console.log("窗口大小可能被手动调整了");
          this.handleResize();
        }
      }, 1000);
    },
  },
};
@@ -664,13 +718,10 @@
.boxEchars {
  width: 100%;
  height: 480px;
  height: 40vh;
  margin-top: 45px;
  display: flex;
  .echars1 {
    flex: 1;
  }
  .echars2 {
    flex: 1;
  }
}
@@ -757,7 +808,7 @@
.empenty {
  width: 100%;
  padding: 20px 0;
  height: 280px;
  min-height: 280px;
}
.cooperate {
  width: 100%;
@@ -765,7 +816,7 @@
  margin-top: 25px;
  display: flex;
  .pieChart {
    flex: 3;
    flex: 1;
  }
  .Points {
    width: 154px;
@@ -910,16 +961,31 @@
.bg-purple {
  background: #fff;
}
.bg-purples {
  color: #206abe;
  font-size: 18px;
}
.bg-purple-light {
  background: #e5e9f2;
  text-align: center;
  align-items: center;
  line-height: 36px;
  width: 6vw;
}
.subtitle {
  text-align: center;
  align-items: center;
}
.grid-content {
  min-height: 36px;
  border-radius: 20px;
  padding: 0 20px;
  padding: 0 10px;
}
.grid-contents {
  min-height: 36px;
  border-radius: 20px;
  padding: 0 10px;
  padding-right: 0;
}
.row-bg {
  padding: 10px 0;