echarts 双堆叠柱状图(数据整理)

news2024/11/16 15:47:50

1.后台返回的数据格式

{
    "code": "0000",
    "message": "",
    "messageCode": "操作成功",
    "sign": null,
    "detail": null,
    "data": {
        "pieChart": [
            {
                "key": "产品问题",
                "value": 32
            },
            {
                "key": "安装问题",
                "value": 8
            },
            {
                "key": "其他",
                "value": 1107
            },
            {
                "key": "远程服务",
                "value": 1
            }
        ],
        "list": null,
        "yearDimensionRespList": [
            {
                "month": 1,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "安装问题",
                            "value": 1
                        },
                        {
                            "key": "其他",
                            "value": 1031
                        },
                        {
                            "key": "产品问题",
                            "value": 5
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": [
                        {
                            "key": "其他",
                            "value": 1031
                        },
                        {
                            "key": "产品问题",
                            "value": 5
                        },
                        {
                            "key": "安装问题",
                            "value": 1
                        }
                    ]
                }
            },
            {
                "month": 2,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "安装问题",
                            "value": 1
                        },
                        {
                            "key": "产品问题",
                            "value": 14
                        },
                        {
                            "key": "其他",
                            "value": 53
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": [
                        {
                            "key": "产品问题",
                            "value": 14
                        },
                        {
                            "key": "安装问题",
                            "value": 1
                        },
                        {
                            "key": "其他",
                            "value": 53
                        }
                    ]
                }
            },
            {
                "month": 3,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "产品问题",
                            "value": 5
                        },
                        {
                            "key": "安装问题",
                            "value": 6
                        },
                        {
                            "key": "其他",
                            "value": 17
                        },
                        {
                            "key": "远程服务",
                            "value": 1
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": [
                        {
                            "key": "其他",
                            "value": 17
                        },
                        {
                            "key": "产品问题",
                            "value": 5
                        },
                        {
                            "key": "安装问题",
                            "value": 6
                        },
                        {
                            "key": "远程服务",
                            "value": 1
                        }
                    ]
                }
            },
            {
                "month": 4,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "其他",
                            "value": 15
                        },
                        {
                            "key": "产品问题",
                            "value": 8
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": [
                        {
                            "key": "其他",
                            "value": 6
                        },
                        {
                            "key": "产品问题",
                            "value": 8
                        }
                    ]
                }
            },
            {
                "month": 5,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "产品问题",
                            "value": 2
                        },
                        {
                            "key": "其他",
                            "value": 10
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 6,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "其他",
                            "value": 2
                        },
                        {
                            "key": "产品问题",
                            "value": 1
                        },
                        {
                            "key": "远程服务",
                            "value": 1
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 7,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "产品问题",
                            "value": 16
                        },
                        {
                            "key": "远程服务",
                            "value": 4
                        },
                        {
                            "key": "其他",
                            "value": 15
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 8,
                "lastYearPair": {
                    "key": 2023,
                    "value": []
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 9,
                "lastYearPair": {
                    "key": 2023,
                    "value": [
                        {
                            "key": "其他",
                            "value": 2
                        },
                        {
                            "key": "产品问题",
                            "value": 5
                        },
                        {
                            "key": "远程服务",
                            "value": 1
                        }
                    ]
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 10,
                "lastYearPair": {
                    "key": 2023,
                    "value": []
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 11,
                "lastYearPair": {
                    "key": 2023,
                    "value": []
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            },
            {
                "month": 12,
                "lastYearPair": {
                    "key": 2023,
                    "value": []
                },
                "currentYearPair": {
                    "key": 2024,
                    "value": []
                }
            }
        ]
    },
    "success": true
}

2.代码 indexC optionC optionCYear

<template>
  <!-- 售后服务工单 -->
  <div class="production-box">
    <!-- 顶部时间切换 -->
    <TopTab @handleClickDateTab="handleClickDateTab" />
    <!-- 主体内容 -->
    <div class="content">
      <!-- !!!!售后工单渠道占比!!!!!! -->
      <div class="sales">
        <!-- 顶部标题 -->
        <div class="top-title">
          <div>
            <div>售后工单渠道占比</div>
            <div @click="showDialogs(0)"></div>
          </div>
          <div v-if="0">详情</div>
        </div>
        <!-- 中部标题 -->
        <div class="middle-title">
          <div class="hardware-bg"></div>
          <div>{{ state.titleA }}</div>
        </div>
        <!-- echarts图表环形 -->
        <div class="chart-info">
          <EChart
            :option="state.circleOptionA"
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
        <!-- 底部标题 -->
        <div class="bottom-title">
          <div>
            <div class="data-bg"></div>
            <div class="bottom-title_bold">{{ state.subtitleA }}</div>
          </div>
          <div>
            <div style="width: 18px"></div>
            <div class="bottom-title_think">{{ state.timeRangA }}</div>
          </div>
        </div>
        <!-- echarts图表 -->
        <div class="chart-info">
          <EChart
            :option="
              state.queryType != 'year' ? state.optionA : state.optionAYear
            "
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
      </div>
      <!-- !!!!售后问题统计!!!!!! -->
      <div class="sales">
        <!-- 顶部标题 -->
        <div class="top-title">
          <div>
            <div>售后问题统计</div>
            <div @click="showDialogs(1)"></div>
          </div>
          <div  @click="handleClickDetailB">详情</div>
        </div>
        <!-- 中部标题 -->
        <div class="middle-title">
          <div class="hardware-bg"></div>
          <div>{{ state.titleB }}</div>
        </div>
        <!-- echarts图表环形 -->
        <div class="chart-info">
          <EChart
            :option="state.circleOptionB"
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
        <!-- 底部标题 -->
        <div class="bottom-title">
          <div>
            <div class="data-bg"></div>
            <div class="bottom-title_bold">{{ state.subtitleB }}</div>
          </div>
          <div>
            <div style="width: 18px"></div>
            <div class="bottom-title_think">{{ state.timeRangB }}</div>
          </div>
        </div>
        <!-- echarts图表 -->
        <div class="chart-info">
          <EChart
            :option="
              state.queryType != 'year' ? state.optionB : state.optionBYear
            "
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
      </div>
      <!-- !!!!售后工单数统计!!!!!! -->
      <div class="sales">
        <!-- 顶部标题 -->
        <div class="top-title">
          <div>
            <div>售后工单数统计</div>
            <div @click="showDialogs(2)"></div>
          </div>
          <div @click="handleClickDetailC">详情</div>
        </div>
        <!-- 中部标题 -->
        <div class="middle-title">
          <div class="hardware-bg"></div>
          <div>{{ state.titleC }}</div>
        </div>
        <!-- echarts图表环形 -->
        <div class="chart-info">
          <EChart
            :option="state.circleOptionC"
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
        <!-- 底部标题 -->
        <div class="bottom-title">
          <div>
            <div class="data-bg"></div>
            <div class="bottom-title_bold">{{ state.subtitleC }}</div>
          </div>
          <div>
            <div style="width: 18px"></div>
            <div class="bottom-title_think">{{ state.timeRangC }}</div>
          </div>
        </div>
        <!-- echarts图表 -->
        <div class="chart-info">
          <EChart
            :option="
              state.queryType != 'year' ? state.optionC : state.optionCYear
            "
            :width="state.width"
            :height="state.height"
            isClick
          />
        </div>
      </div>
      <div class="up-time">数据更新时间:{{ store.state.updateTime }}</div>
    </div>

    <van-dialog v-model:show="state.show" title="" confirmButtonText="知道了">
      <div class="dialog-content">
        <div
            v-for="(item, index) in state.currentTipList"
            :key="index"
            class="dia-cent"
        >
          {{ item }}
        </div>
      </div>
    </van-dialog>

  </div>
</template>

<script setup>
import { getCurrentInstance, onMounted, reactive, inject, ref } from "vue";
import TopTab from "../../component/top-tab.vue";
import EChart from "@/component/charts.vue";
import moment from "moment";
import {useRouter} from "vue-router";
import store from '@/store/index';

// echart 初始化
const echarts = inject("ec");
const { proxy } = getCurrentInstance();
const router = useRouter();

const tips = ref([
  {
    title: "售后工单渠道占比",
    list: [
      "「售后工单渠道占比」数据取自主服系统中售后服务工单表;",
      "时间维度为分别为日(当日)、周(本周周一至当日)、月(本月1日至当日)、年(当年1月1日至当日)的出货总数量;",
      "区分售后工单来源渠道,分别为车企、电商新零售、海外、公共配套;",
      "饼状图统计各渠道同一时间维度下数量及占比情况;",
      "柱状图统计各渠道同一时间维度下数量变化的趋势情况;",
    ],
  },
  {
    title: "售后问题统计",
    list: [
      "「售后问题统计」数据取自主服系统售后服务工单表中状态为已完成的数据;",
      "时间维度为分别为日(当日)、周(本周周一至当日)、月(本月1日至当日)、年(当年1月1日至当日)的工单总数量;",
      "根据售后问题解决方案区分售后工单问题,分别为产品问题、安装问题、远程服务、检测无故障、其他;",
      "工单问题类型为其他的表示该工单为填写解决方案;",
      "饼状图统计各渠道同一时间维度下问题数量及占比情况;",
      "柱状图统计各渠道同一时间维度下问题数量变化的趋势情况;",
    ],
  },
  {
    title: "售后工单数统计",
    list: [
      "「售后工单数统计」数据取自主服系统售后服务工单表中状态为已完成的数据;",
      "时间维度为分别为日(当日)、周(本周周一至当日)、月(本月1日至当日)、年(当年1月1日至当日)的工单总数量;",
      "饼状图统计各渠道同一时间维度下售后工单数量在全部工单的占比情况;",
      "柱状图统计各渠道同一时间维度下售后工单在全部工单的占比数量变化的趋势情况;",
    ],
  },
]);

const state = reactive({
  show: false,
  currentTipList: [],

  width: "100%",
  height: "240px",
  queryType: "day",
  eightWeek: {
    startTime: "",
    endTime: "",
  },
  currentYear: "",
  lastYear: "",
  year: moment().format("YYYY"),
  indexA: 0,
  indexB: 0,
  indexC: 0,
  titleA: "",
  subtitleA: "",
  timeRangA: "",
  titleB: "",
  subtitleB: "",
  timeRangB: "",
  titleC: "",
  subtitleC: "",
  timeRangC: "",
  optionA: {
    //日月周
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: true,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  optionAYear: {
    //年
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
      formatter: function (params) {
        console.log("state.currentYear=" + params.length);
        var res =
          "<div>时间:" +
          params[0].name +
          "</div><hr><div>" +
          state.lastYear +
          ":</div>";
        for (var i = 0; i < params.length; i++) {
          res +=
            "<div>" +
            params[i].marker +
            params[i].seriesName +
            ":" +
            params[i].data +
            "</div>";
          if (i == state.indexA) {
            res += "<hr><div>" + state.currentYear + ":</div>";
          }
        }
        return res;
      },
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: false,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  optionB: {
    //日月周
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: true,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  optionBYear: {
    //年
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
      formatter: function (params) {
        console.log("state.currentYear=" + params.length);
        var res =
          "<div>时间:" +
          params[0].name +
          "</div><hr><div>" +
          state.lastYear +
          ":</div>";
        for (var i = 0; i < params.length; i++) {
          res +=
            "<div>" +
            params[i].marker +
            params[i].seriesName +
            ":" +
            params[i].data +
            "</div>";
          if (i == state.indexB) {
            res += "<hr><div>" + state.currentYear + ":</div>";
          }
        }
        return res;
      },
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: false,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  optionC: {
    //日月周
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: true,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  optionCYear: {
    //年
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    tooltip: {
      trigger: "axis",
      confine: true,
      formatter: function (params) {
        console.log("state.currentYear=" + params.length);
        var res =
          "<div>时间:" +
          params[0].name +
          "</div><hr><div>" +
          state.lastYear +
          ":</div>";
        for (var i = 0; i < params.length; i++) {
          res +=
            "<div>" +
            params[i].marker +
            params[i].seriesName +
            ":" +
            params[i].data +
            "</div>";
          if (i == state.indexC) {
            res += "<hr><div>" + state.currentYear + ":</div>";
          }
        }
        return res;
      },
    },
    legend: {
      x: "center",
      y: "bottom",
      // width: 60,
      itemWidth: 18, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 12,
      },
      selectedMode: false,
    },
    xAxis: [
      {
        type: "category",
        data: [],
        axisPointer: {
          type: "shadow",
        },
        axisTick: {
          show: false, // 隐藏刻度线
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: "#A4A4A4", // 设置轴线的颜色,这里以红色为例
          },
        },
        axisLabel: {
          rotate: 35,
          interval: 0,
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        min: 0,
        // max: 10000,
        // interval: 2000,
        axisLabel: {
          formatter: "{value} ",
          textStyle: {
            color: "#A4A4A4", // 文本颜色
            fontSize: 8, // 文本大小
          },
        },
      },
    ],
    series: [],
  },
  circleOptionA: {
    tooltip: {
      trigger: "item",
      confine: true,
    },
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    legend: {
      top: "80%",
      left: "center",
      // width: 60,
      itemWidth: 17, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 10,
      },
    },
    series: [
      {
        name: "",
        type: "pie",
        radius: ["40%", "55%"], //环形图的大小
        center: ["50%", "40%"], //环形图位置
        // adjust the start and end angle
        startAngle: 180,
        endAngle: 360,
        data: [],
      },
    ],
  },
  circleOptionB: {
    tooltip: {
      trigger: "item",
      confine: true,
    },
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    legend: {
      top: "80%",
      left: "center",
      // width: 60,
      itemWidth: 17, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 10,
      },
    },
    series: [
      {
        name: "",
        type: "pie",
        radius: ["40%", "55%"], //环形图的大小
        center: ["50%", "40%"], //环形图位置
        // adjust the start and end angle
        startAngle: 180,
        endAngle: 360,
        data: [],
      },
    ],
  },
  circleOptionC: {
    tooltip: {
      trigger: "item",
      confine: true,
    },
    grid: {
      top: "16px",
      left: "16px",
      right: "16px",
      bottom: "32px",
      containLabel: true,
    },
    legend: {
      top: "80%",
      left: "center",
      // width: 60,
      itemWidth: 17, //图例长度
      itemHeight: 6, //图例宽度
      icon: "roundRect",
      textStyle: {
        //图例文字
        color: "#000000",
        fontSize: 10,
      },
    },
    series: [
      {
        name: "",
        type: "pie",
        radius: ["40%", "55%"], //环形图的大小
        center: ["50%", "40%"], //环形图位置
        // adjust the start and end angle
        startAngle: 180,
        endAngle: 360,
        data: [],
      },
    ],
  },
});

// 问号弹出框
const showDialogs = (val) => {
  state.show = true;
  state.currentTipList = tips.value[val].list;
};

const handleClickDateTab = (row) => {
  console.log(row);
  state.queryType = row.value;
  init();
};

// 售后工单渠道占比
const getaftersaleChannelNum = () => {
  proxy.$H
    .post(proxy, proxy.$A.aftersaleChannelNum, {
      accessType: "web",
      data: state.queryType,
    })
    .then((res) => {
      if (state.queryType != "year") {
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionA.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //柱状堆叠图
        //X轴数据
        if (res.data.data.list.length > 0) {
          state.optionA.xAxis[0].data = res.data.data.list.map((item) => {
            return item.date;
          });
          //serios的name集合
          let seriosNameList = [];
          state.optionA.series = [];
          for (let item of res.data.data.list) {
            for (let ite of item.channelList) {
              if (!seriosNameList.includes(ite.key)) {
                seriosNameList.push(ite.key);
              }
            }
          }
          console.log("长度为:" + seriosNameList.length);

          seriosNameList.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: "total",
              data: [],
              barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionA.series.push(seriesObj);

            console.log(state.optionA.series);
            for (let item of res.data.data.list) {
              if (item.channelList.length > 0) {
                if (item.channelList.some((ite) => ite.key == element)) {
                  for (let it of item.channelList) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      } else {
        //年的数据
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionA.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //serios的name集合
        let seriosNameListA = []; //去年的
        let seriosNameListB = []; //今年的
        state.optionAYear.series = [];
        //柱状堆叠图
        //X轴数据
        if (res.data.data.yearDimensionRespList.length > 0) {
          state.optionAYear.xAxis[0].data = res.data.data.yearDimensionRespList.map(
            (item) => {
              return item.month + "月";
            }
          );

          for (let item of res.data.data.yearDimensionRespList) {
            state.currentYear = item.currentYearPair.key;
            state.lastYear = item.lastYearPair.key;
            for (let ite of item.lastYearPair.value) {
              if (!seriosNameListA.includes(ite.key)) {
                seriosNameListA.push(ite.key);
              }
            }
            for (let ite of item.currentYearPair.value) {
              if (!seriosNameListB.includes(ite.key)) {
                seriosNameListB.push(ite.key);
              }
            }
          }
          console.log(seriosNameListA);
          console.log(seriosNameListB);
          //去年堆叠图
          state.indexA = seriosNameListA.length - 1; //tooltip 转换的下标
          seriosNameListA.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.lastYear,
              data: [],
              // barWidth: "50%",
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionAYear.series.push(seriesObj);

            console.log(state.optionAYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.lastYearPair.value.length > 0) {
                if (item.lastYearPair.value.some((ite) => ite.key == element)) {
                  for (let it of item.lastYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
          //今年堆叠图
          seriosNameListB.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.currentYear,
              data: [],
              // barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionAYear.series.push(seriesObj);

            console.log(state.optionAYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.currentYearPair.value.length > 0) {
                if (
                  item.currentYearPair.value.some((ite) => ite.key == element)
                ) {
                  for (let it of item.currentYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      }

      //标题变更
      const today = moment();
      let startDate = "";
      let endDate = "";
      if (state.queryType == "day") {
        state.titleA = `${moment()
          .subtract(1, "days")
          .format("YYYY-MM-DD")}售后工单渠道数量及占比`;
        state.subtitleA = `近7日售后工单渠道数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangA = `(${startDate}~${endDate})`;
      } else if (state.queryType == "week") {
        state.titleA = `本周(${
          res.data.data.list[res.data.data.list.length - 1].date
        })售后工单渠道数量及占比`;
        state.subtitleA = `近8周售后工单渠道数量变化`;
        state.timeRangA = `(${state.eightWeek.startTime}~${state.eightWeek.endTime})`;
      } else if (state.queryType == "month") {
        state.titleA = `售后工单渠道数量及占比`;
        state.subtitleA = `近6个售后工单渠道数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangA = `(${startDate}~${endDate})`;
      } else {
        state.titleA = `${state.year}售后工单渠道数量及占比`;
        state.subtitleA = "售后工单渠道数量对比变化";
      }
    });
};
// 售后问题统计
const getaftersaleFaultNum = () => {
  proxy.$H
    .post(proxy, proxy.$A.aftersaleFaultNum, {
      accessType: "web",
      data: state.queryType,
    })
    .then((res) => {
      if (state.queryType != "year") {
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionB.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //柱状堆叠图
        //X轴数据
        if (res.data.data.list.length > 0) {
          state.optionB.xAxis[0].data = res.data.data.list.map((item) => {
            return item.date;
          });
          //serios的name集合
          let seriosNameList = [];
          state.optionB.series = [];
          for (let item of res.data.data.list) {
            for (let ite of item.channelList) {
              if (!seriosNameList.includes(ite.key)) {
                seriosNameList.push(ite.key);
              }
            }
          }
          console.log("长度为:" + seriosNameList.length);

          seriosNameList.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: "total",
              data: [],
              barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionB.series.push(seriesObj);

            console.log(state.optionB.series);
            for (let item of res.data.data.list) {
              if (item.channelList.length > 0) {
                if (item.channelList.some((ite) => ite.key == element)) {
                  for (let it of item.channelList) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      } else {
        //年的数据
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionB.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //serios的name集合
        let seriosNameListA = []; //去年的
        let seriosNameListB = []; //今年的
        state.optionBYear.series = [];
        //柱状堆叠图
        //X轴数据
        if (res.data.data.yearDimensionRespList.length > 0) {
          state.optionBYear.xAxis[0].data = res.data.data.yearDimensionRespList.map(
            (item) => {
              return item.month + "月";
            }
          );

          for (let item of res.data.data.yearDimensionRespList) {
            state.currentYear = item.currentYearPair.key;
            state.lastYear = item.lastYearPair.key;
            for (let ite of item.lastYearPair.value) {
              if (!seriosNameListA.includes(ite.key)) {
                seriosNameListA.push(ite.key);
              }
            }
            for (let ite of item.currentYearPair.value) {
              if (!seriosNameListB.includes(ite.key)) {
                seriosNameListB.push(ite.key);
              }
            }
          }
          console.log(seriosNameListA);
          console.log(seriosNameListB);
          //去年堆叠图
          state.indexB = seriosNameListA.length - 1; //tooltip 转换的下标
          seriosNameListA.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.lastYear,
              data: [],
              // barWidth: "50%",
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionBYear.series.push(seriesObj);

            console.log(state.optionBYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.lastYearPair.value.length > 0) {
                if (item.lastYearPair.value.some((ite) => ite.key == element)) {
                  for (let it of item.lastYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
          //今年堆叠图
          seriosNameListB.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.currentYear,
              data: [],
              // barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionBYear.series.push(seriesObj);

            console.log(state.optionBYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.currentYearPair.value.length > 0) {
                if (
                  item.currentYearPair.value.some((ite) => ite.key == element)
                ) {
                  for (let it of item.currentYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      }

      //标题变更
      const today = moment();
      let startDate = "";
      let endDate = "";
      if (state.queryType == "day") {
        state.titleB = `${moment()
          .subtract(1, "days")
          .format("YYYY-MM-DD")}售后问题数量及占比`;
        state.subtitleB = `近7日售后问题数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangB = `(${startDate}~${endDate})`;
      } else if (state.queryType == "week") {
        state.titleB = `本周(${
          res.data.data.list[res.data.data.list.length - 1].date
        })售后问题数量及占比`;
        state.subtitleB = `近8周售后问题数量变化`;
        state.timeRangB = `(${state.eightWeek.startTime}~${state.eightWeek.endTime})`;
      } else if (state.queryType == "month") {
        state.titleB = `本月售后问题数量及占比`;
        state.subtitleB = `近6个售后问题数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangB = `(${startDate}~${endDate})`;
      } else {
        state.titleB = `${state.year}售后问题数量及占比`;
        state.subtitleB = "售后问题数量对比变化";
      }
    });
};
// 售后工单数统计
const getaftersaleAndInstallOrderNum = () => {
  proxy.$H
    .post(proxy, proxy.$A.aftersaleAndInstallOrderNum, {
      accessType: "web",
      data: state.queryType,
    })
    .then((res) => {
      if (state.queryType != "year") {
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionC.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //柱状堆叠图
        //X轴数据
        if (res.data.data.list.length > 0) {
          state.optionC.xAxis[0].data = res.data.data.list.map((item) => {
            return item.date;
          });
          //serios的name集合
          let seriosNameList = [];
          state.optionC.series = [];
          for (let item of res.data.data.list) {
            for (let ite of item.channelList) {
              if (!seriosNameList.includes(ite.key)) {
                seriosNameList.push(ite.key);
              }
            }
          }
          console.log("长度为:" + seriosNameList.length);

          seriosNameList.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: "total",
              data: [],
              barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionC.series.push(seriesObj);

            console.log(state.optionC.series);
            for (let item of res.data.data.list) {
              if (item.channelList.length > 0) {
                if (item.channelList.some((ite) => ite.key == element)) {
                  for (let it of item.channelList) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      } else {
        //年的数据
        //饼状图数据
        if (res.data.data.pieChart.length > 0) {
          state.circleOptionC.series[0].data = res.data.data.pieChart.map(
            (item) => {
              return {
                name: item.key,
                value: item.value,
              };
            }
          );
        }
        //serios的name集合
        let seriosNameListA = []; //去年的
        let seriosNameListB = []; //今年的
        state.optionCYear.series = [];
        //柱状堆叠图
        //X轴数据
        if (res.data.data.yearDimensionRespList.length > 0) {
          state.optionCYear.xAxis[0].data = res.data.data.yearDimensionRespList.map(
            (item) => {
              return item.month + "月";
            }
          );

          for (let item of res.data.data.yearDimensionRespList) {
            state.currentYear = item.currentYearPair.key;
            state.lastYear = item.lastYearPair.key;
            for (let ite of item.lastYearPair.value) {
              if (!seriosNameListA.includes(ite.key)) {
                seriosNameListA.push(ite.key);
              }
            }
            for (let ite of item.currentYearPair.value) {
              if (!seriosNameListB.includes(ite.key)) {
                seriosNameListB.push(ite.key);
              }
            }
          }
          console.log(seriosNameListA);
          console.log(seriosNameListB);
          //去年堆叠图
          state.indexC = seriosNameListA.length - 1; //tooltip 转换的下标
          seriosNameListA.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.lastYear,
              data: [],
              // barWidth: "50%",
            };
            console.log(index);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionCYear.series.push(seriesObj);

            console.log(state.optionCYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.lastYearPair.value.length > 0) {
                if (item.lastYearPair.value.some((ite) => ite.key == element)) {
                  for (let it of item.lastYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
          //今年堆叠图
          seriosNameListB.forEach((element, index) => {
            let seriesObj = {
              name: "",
              type: "bar",
              stack: state.currentYear,
              data: [],
              // barWidth: "50%",
              // itemStyle: {
              //   normal: {
              //     color: {
              //       type: "linear",
              //       x: 0,
              //       y: 0,
              //       x2: 0,
              //       y2: 1,
              //       colorStops: [
              //         {
              //           offset: 0,
              //           color: "rgba(253,148,12,0.54)", // 柱子上部颜色
              //         },
              //         {
              //           offset: 1,
              //           color: "rgba(254,71,1,0.54)", // 柱子下部颜色
              //         },
              //       ],
              //       globalCoord: false, // 缺省值false
              //     },
              //   },
              // },
            };
            console.log(state.indexC);
            console.log("name=" + element);
            seriesObj.name = element;
            state.optionCYear.series.push(seriesObj);

            console.log(state.optionCYear.series);
            for (let item of res.data.data.yearDimensionRespList) {
              if (item.currentYearPair.value.length > 0) {
                if (
                  item.currentYearPair.value.some((ite) => ite.key == element)
                ) {
                  for (let it of item.currentYearPair.value) {
                    if (it.key == element) {
                      seriesObj.data.push(it.value);
                    }
                  }
                } else {
                  seriesObj.data.push(0);
                }
              } else {
                seriesObj.data.push(0);
              }
            }
          });
        }
      }

      // 标题变更
      const today = moment();
      let startDate = "";
      let endDate = "";
      if (state.queryType == "day") {
        state.titleC = `${moment()
          .subtract(1, "days")
          .format("YYYY-MM-DD")}售后上门工单数及占比`;
        state.subtitleC = `近7日售后上门工单数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangC = `(${startDate}~${endDate})`;
      } else if (state.queryType == "week") {
        state.titleC = `本周(${
          res.data.data.list[res.data.data.list.length - 1].date
        })售后上门工单数及占比`;
        state.subtitleC = `近8周售后上门工单数量变化`;
        state.timeRangC = `(${state.eightWeek.startTime}~${state.eightWeek.endTime})`;
      } else if (state.queryType == "month") {
        state.titleC = `本月售后上门工单数及占比`;
        state.subtitleC = `近6个售后上门工单数量变化`;
        startDate = res.data.data.list[0].date;
        endDate = res.data.data.list[res.data.data.list.length - 1].date;
        state.timeRangC = `(${startDate}~${endDate})`;
      } else {
        state.titleC = `${state.year}售后上门工单数及占比`;
        state.subtitleC = "售后上门工单数量对比变化";
      }
    });
};
// 售后问题统计
const handleClickDetailB = () => {
  router.push({ name: "problem-statistics" });
};
// 售后工单数统计
const handleClickDetailC = () => {
  router.push({ name: "visit-statistics" });
};
// 初始化
const init = () => {
  getaftersaleChannelNum();
  getaftersaleFaultNum();
  getaftersaleAndInstallOrderNum();
};
onMounted(() => {
  const today = moment();

  // 计算前八周的周一的日期
  const eightWeeksAgo = today.clone().subtract(7, "weeks");
  const mondayOfEightWeeksAgo = eightWeeksAgo.day(1); // 1 represents Monday
  state.eightWeek.startTime = mondayOfEightWeeksAgo.format("MM/DD");
  state.eightWeek.endTime = today.format("MM/DD");
  init();
});
</script>

<style lang="less" scoped>
@import "./index.less";
.dialog-content {
  max-height: 60vh;
  overflow-y:scroll;

  padding: 20px;
  .dia-cent {
    margin-bottom: 3px;
  }
}
</style>

3.效果
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1616276.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C++之写时复制(CopyOnWrite)

设计模式专栏&#xff1a;http://t.csdnimg.cn/4j9Cq 目录 1.简介 2.实现原理 3.QString的实现分析 3.1.内部结构 3.2.写入时复制 4.示例分析 5.使用场景 6.总结 1.简介 CopyOnWrite (COW) 是一种编程思想&#xff0c;用于优化内存使用和提高性能。COW 的基本思想是&am…

编译支持播放H265的cef控件

接着在上次编译的基础上增加h265支持编译支持视频播放的cef控件&#xff08;h264&#xff09; 测试页面&#xff0c;直接使用cef_enhancement,里边带着的那个html即可&#xff0c;h265视频去这个网站下载elecard,我修改的这个版本参考了里边的修改方式&#xff0c;不过我的这个…

Reactor 模式

目录 1. 实现代码 2. Reactor 模式 3. 分析服务器的实现具体细节 3.1. Connection 结构 3.2. 服务器的成员属性 3.2. 服务器的构造 3.3. 事件轮询 3.4. 事件派发 3.5. 连接事件 3.6. 读事件 3.7. 写事件 3.8. 异常事件 4. 服务器上层的处理 5. Reactor 总结 1…

开源啦!一键部署免费使用!Kubernetes上直接运行大数据平台!

市场上首个K8s上的大数据平台&#xff0c;开源啦&#xff01; 智领云自主研发的首个 完全基于Kubernetes的容器化大数据平台 Kubernetes Data Platform (简称KDP) 开源啦&#x1f680;&#x1f680; 开发者只要准备好命令行工具&#xff0c;一键部署 Hadoop&#xff0c;Hi…

JavaScript(二)

JavaScript的语法 1.JavaScript的大小写 在JavaScript中&#xff0c;大小写是敏感的&#xff0c;这意味着大小写不同的标识符被视为不同的变量或函数。例如&#xff0c;myVariable 和 myvariable 被视为两个不同的变量。因此&#xff0c;在编写JavaScript代码时&#xff0c;必…

函数声明与调用:接口原型、参数传递顺序、返回值

示例&#xff1a; /*** brief how about function-declare-call? show you here.* author wenxuanpei* email 15873152445163.com(query for any question here)*/ #define _CRT_SECURE_NO_WARNINGS//support c-library in Microsoft-Visual-Studio #include <stdio.h&…

上位机图像处理和嵌入式模块部署(树莓派4b实现多进程通信)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 和mcu固件、上位机软件不太一样的地方&#xff0c;嵌入式设备上面上面的工业软件一般都是多进程的形式。相比较多线程而言&#xff0c;整个系统就不…

springcloudgateway集成knife4j

上篇我们聊聊springboot是怎么继承knife4j的。springboot3 集成knife4j-CSDN博客 本次我们一起学习springcloudgateway集成knife4j。 环境介绍 java&#xff1a;17 SpringBoot&#xff1a;3.2.0 SpringCloud&#xff1a;2023.0.0 knife4j &#xff1a; 4.4.0 引入maven配置…

# 从浅入深 学习 SpringCloud 微服务架构(四)Ribbon

从浅入深 学习 SpringCloud 微服务架构&#xff08;四&#xff09;Ribbon 段子手168 一、ribbon 概述以及基于 ribbon 的远程调用。 1、ribbon 概述&#xff1a; Ribbon 是 Netflixfa 发布的一个负载均衡器,有助于控制 HTTP 和 TCP客户端行为。 在 SpringCloud 中 Eureka …

就业班 第三阶段(负载均衡) 2401--4.19 day3 nginx3

二、企业 keepalived 高可用项目实战 1、Keepalived VRRP 介绍 keepalived是什么keepalived是集群管理中保证集群高可用的一个服务软件&#xff0c;用来防止单点故障。 ​ keepalived工作原理keepalived是以VRRP协议为实现基础的&#xff0c;VRRP全称Virtual Router Redundan…

用python selenium实现短视频一键推送

https://github.com/coolEphemeroptera/VIVI 效果如下 demo 支持youtube视频搬运

iPerf 3 测试UDP和TCP方法详解

文章目录 前言一、What is iPerf / iPerf3 ?二、功能1. TCP and SCTP2. UDP3. 其他 三、 Iperf的使用1.Iperf的工作模式2. 通用指令3. 服务端特有选项4. 客户端特有选项5. -t -n参数联系 四、Iperf使用实例1. 调整 TCP 连接1. 1TCP 窗口大小调节1. 2 最大传输单元 (MTU)调整 2…

【python项目推荐】键盘监控--统计打字频率

原文&#xff1a;https://greptime.com/blogs/2024-03-19-keyboard-monitoring 代码&#xff1a;https://github.com/GreptimeTeam/demo-scene/tree/main/keyboard-monitor 项目简介 该项目实现了打字频率统计及可视化功能。 主要使用的库 pynput&#xff1a;允许您控制和监…

kafka 命令行使用 消息的写入和读取 quickstart

文章目录 Intro命令日志zookeeper serverkafka servercreate topic && describe topic Intro Kafka在大型系统中可用作消息通道&#xff0c;一般是用程序语言作为客户端去调用kafka服务。 不过在这之前&#xff0c;可以先用下载kafka之后就包含的脚本文件等&#xff0…

在Spring Boot应用中实现阿里云短信功能的整合

1.程序员必备程序网站 天梦星服务平台 (tmxkj.top)https://tmxkj.top/#/ 2.导入坐标 <dependency><groupId>com.aliyun</groupId><artifactId>aliyun-java-sdk-core</artifactId><version>4.5.0</version></dependency><…

Spring IOC 和 DI详解

目录 一、IOC介绍 1、什么是IOC 2、通过案例来了解IoC 2.1 传统程序开发 2.2 问题分析 2.3 解决方案 2.4 IoC程序开发 2.5 IoC 优势 二、DI介绍 三、IOC 详解 3.1 Bean的存储 3.1.1 Controller&#xff08;控制器存储&#xff09; 3.1.2 Service&#xff08;服务存…

照片相似性搜索引擎Embed-Photos;赋予大型语言模型(LLMs)视频和音频理解能力;OOTDiffusion的基础上可控制的服装驱动图像合成

✨ 1: Magic Clothing Magic Clothing是一个以可控制的服装驱动图像合成为核心的技术项目&#xff0c;建立在OOTDiffusion的基础上 Magic Clothing是一个以可控制的服装驱动图像合成为核心的技术项目&#xff0c;建立在OOTDiffusion的基础上。通过使用Magic Clothing&#xf…

hadoop安装记录

零、版本说明 centos [rootnode1 ~]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)jdk [rootnode1 ~]# java -version java version "1.8.0_311" Java(TM) SE Runtime Environment (build 1.8.0_311-b11) Java HotSpot(TM) 64-Bit Server VM (…

STL_List与萃取

List 参考文章: https://blog.csdn.net/weixin_45389639/article/details/121618243 List源码 List中节点的定义&#xff1a; list是双向列表&#xff0c;所以其中节点需要包含指向前一节点和后一节点的指针&#xff0c; data是节点中存储的数据类型 template <class _Tp&g…

海康Visionmaster-常见问题排查方法-启动阶段

VM试用版启动时&#xff0c;弹窗报错&#xff1a;加密狗未安装或检测异常&#xff1b;  问题原因&#xff1a;安装VM 的时候未选择软加密&#xff0c;选择了加密狗驱动&#xff0c;此时要使用软授权就出现了此现象。  解决方法&#xff1a; ① 首先确认软加密驱动正确安装…