liuyg
2021-07-19 d554219390c8a33bc91921d459b37ecbce323062
主页注册量 对接数据
3 files modified
54 ■■■■■ changed files
src/api/home/home.js 4 ●●●● patch | view | raw | blame | history
src/views/wel/home.vue 49 ●●●●● patch | view | raw | blame | history
vue.config.js 1 ●●●● patch | view | raw | blame | history
src/api/home/home.js
@@ -1,8 +1,8 @@
import request from '@/router/axios';
export const startList = () => {
export const getList = () => {
  return request({
    url: '/api/blade-user/getUserRegisterStatisticsData',
    method: 'get',
    method: 'get'
  })
}
src/views/wel/home.vue
@@ -101,7 +101,7 @@
import * as echarts from "echarts";
import geojson from "@/geojson/nanchang.json";
// import { getList } from "@api/home/home";
import { getList } from "@/api/home/home";
export default {
  data() {
@@ -264,9 +264,17 @@
    onSixEcharts() {
      this.echarts1.clear();
      //改折线图
      // getList.then((res) => {
      //   console.log(res, 243423);
      // });
      var that = this;
      getList().then((res) => {
        var data = [];
        var datax = [];
        var d = res.data.data;
        for (var k in d) {
          data.push(d[k].num);
          datax.push(d[k].region);
        }
        console.log(res, 243423);
      var option = {
        tooltip: {
          trigger: "axis",
@@ -294,17 +302,18 @@
        xAxis: [
          {
            type: "category",
            data: [
              "东湖区",
              "西湖区",
              "青云谱区",
              "青山湖区",
              "新建区",
              "红谷滩区",
              "南昌县",
              "安义县",
              "进贤县",
            ],
              data: datax,
              // [
              //   "东湖区",
              //   "西湖区",
              //   "青云谱区",
              //   "青山湖区",
              //   "新建区",
              //   "红谷滩区",
              //   "南昌县",
              //   "安义县",
              //   "进贤县",
              // ],
            axisLine: {
              show: true,
              lineStyle: {
@@ -336,6 +345,7 @@
            axisTick: {
              show: false,
            },
              minInterval: 1,
            axisLine: {
              show: false,
              lineStyle: {
@@ -344,7 +354,7 @@
                type: "solid",
              },
            },
            // max: 100,
              // max: 3,
            // min: 0,
            splitLine: {
              lineStyle: {
@@ -386,7 +396,8 @@
          {
            name: "注册量",
            type: "bar",
            data: [44, 46, 48, 52, 55, 45, 56, 38, 66],
              // data: [44, 46, 48, 52, 55, 45, 56, 38, 66],
              data: data,
            barWidth: 6, //柱子宽度
            barGap: 0.4, //柱子之间间距
            itemStyle: {
@@ -411,6 +422,7 @@
            data: [50, 54, 58, 55, 65, 72, 44, 55, 58],
            // barWidth: 6,
            // barGap: 0.4,
              yAxisIndex: 1,
            itemStyle: {
              normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@@ -429,7 +441,8 @@
          },
        ],
      };
      this.echarts1.setOption(option);
        that.echarts1.setOption(option);
      });
    },
    createMapJson() {
vue.config.js
@@ -37,6 +37,7 @@
      '/api': {
        //本地服务接口地址
        target: 'http://s16s652780.51mypc.cn/api/',
        // target: 'http://192.168.0.114:82/',
        //target: 'http://localhost:82/',
        //target: 'https://web.byisf.com/api/',
        //远程演示服务地址,可用于直接启动项目