yangfeng
2023-12-07 1dbdda3517a01851d8d9894b22e61aa4462b541c
src/views/cockpitPage/components/PerSonnelProductivity.vue
@@ -70,6 +70,9 @@
            axisPointer: {
              type: "none",
            },
            valueFormatter: function (value) {
              return value + "%";
            },
          },
          grid: {
            right: "80px",
@@ -136,7 +139,7 @@
          xAxis: [
            {
              type: "value",
              name: "单位:件",
              // name: "单位:件",
              // min: data.yAxis[0].min?data.yAxis.min:0,
              minInterval: 1, //坐标轴是整数
              max: Math.ceil(eval(`Math.max(${data.datay})`) / 5) * 5, //数据最大值加3
@@ -236,7 +239,6 @@
    },
    getChartRight(chartName, data) {
      let chartDom = this.$refs[chartName];
      // let myRightChart = echarts.init(chartDom);
      if (
        myRightChart != null &&
        myRightChart != "" &&
@@ -246,22 +248,27 @@
      }
      myRightChart = echarts.init(chartDom);
      let img = "/cockpitPage/dotted-circle.png";
      let height = myRightChart.getHeight() / 1;
      let width = height + 5;
      let option;
      if (data) {
        option = {
          color: ["#dcb018", "#735b09", "#ebd68e", "#c7b36e"],
          tooltip: {
            trigger: "item",
            valueFormatter: function (value) {
              return value + "%";
            },
          },
          graphic: {
            elements: [
              {
                type: "image",
                z: 3,
                // z: 3,
                style: {
                  image: img,
                  width: 240,
                  height: 240,
                  width: width,
                  height: height,
                },
                left: "center",
                top: "center",
@@ -285,7 +292,11 @@
                  borderWidth: 5,
                  borderRadius: 4,
                  formatter: function (params) {
                    return `{a|${params.name}} {b|${params.value + "%"}}`;
                    let label =
                      params.name.length > 4
                        ? `${params.name.slice(0, 3)}...`
                        : params.name;
                    return `{a|${label}} {b|${params.value + "%"}}`;
                  },
                  rich: {
                    a: {
@@ -310,7 +321,7 @@
              labelLine: {
                show: true,
                length: 4,
                length2: 80,
                length2: 70,
                lineStyle: {
                  color: "#dcb018",
                },
@@ -337,7 +348,7 @@
<style scoped lang="scss">
.bar-chart {
  width: 100%;
  height: calc(100% - 20px);
  height: calc(100% - 10px);
  padding: 20px 0 0;
  .bar-contents {
@@ -346,7 +357,7 @@
    .chart-left {
      width: calc(60% - 20px);
      height: 100%;
      height: calc(100% - 20px);
      margin-right: 20px;
      float: left;
      border: 1px solid #00ffff;
@@ -356,7 +367,7 @@
    .chart-right {
      width: 40%;
      float: left;
      height: 100%;
      height: calc(100% - 20px);
      position: relative;
      .chart-bg {
        width: 100%;