单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-07-24 2cf080c66255c3dae4f4a96c56a2051e9d3d246e
src/views/test.vue
@@ -29,45 +29,75 @@
  
        const option = {
          title: {
            text: '营养状态和透析情况',
            left: 'center'
          },
          tooltip: {
            trigger: 'axis'
          },
          xAxis: {
            type: 'category',
            data: ['12:21', '12:22', '12:23', '12:24', '12:25', '12:26', '12:27', '12:28', '12:29', '12:30', '12:31', '12:32', '12:33', '12:34', '12:35', '12:36', '12:37', '12:38']
          },
          yAxis: {
            type: 'value'
          },
          series: [
            {
              data: [1.4, 1.2, 1.4, 1.4, 1.0, 1.4, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.7],
              type: 'line',
              smooth: true,
              color:'red',
              itemStyle: {
                color: function(params) {
                  if (params.value > 1.2) {
                      return 'red';
                  } else {
                      return 'blue';
                  }
                }.bind(this)
              },
              lineStyle: {
                color: function(params) {
                  if (params.value > 1.2) {
                      return 'red';
                  } else {
                      return 'blue';
                  }
                }.bind(this)
              }
            }
          ]
    text: 'Distribution of Electricity',
    subtext: 'Fake Data'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    }
  },
  toolbox: {
    show: true,
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    // prettier-ignore
    data: ['00:00', '01:15', '02:30', '03:45', '05:00', '06:15', '07:30', '08:45', '10:00', '11:15', '12:30', '13:45', '15:00', '16:15', '17:30', '18:45', '20:00', '21:15', '22:30', '23:45']
  },
  yAxis: {
    type: 'value',
    axisLabel: {
      formatter: '{value} W'
    },
    axisPointer: {
      snap: true
    }
  },
  visualMap: {
    show: false,
    dimension: 0,
    pieces: [
      {
        lte: 2,
        color: 'green'
      },
      {
        gt: 2,
        lte: 8,
        color: 'red'
      },
      {
        gt: 8,
        lte: 14,
        color: 'green'
      },
      {
        gt: 14,
        lte: 17,
        color: 'red'
      },
      {
        gt: 17,
        color: 'green'
      }
    ]
  },
  series: [
    {
      name: 'Electricity',
      type: 'line',
      smooth: true,
      // prettier-ignore
      data: [300, 280, 250, 260, 270, 300, 550, 500, 400, 390, 380, 390, 400, 500, 600, 750, 800, 700, 600, 400],
    }
  ]
        };
  
        this.chartInstance.setOption(option);