common.js 5.55 KB
let dayIndexArray = [
  [
    {
      title: '已开业门店数量',
      value: 0,
      unit: '座'
    },
    {
      title: '当日客流',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '昨日客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '上周同期',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '去年同期',
      value: 0,
      unit: '人次'
    },
    {
      title: '店均客流',
      value: 0,
      unit: '人次'
    }
  ],
]

let weekIndexArray = [
  [
    {
      title: '本周客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '日均客流量',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '上周客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '去年同期',
      value: 0,
      unit: '人次'
    }
  ],
]

let monthIndexArray = [
  [
    {
      title: '本月客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '日均客流量',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '上月客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '去年同期',
      value: 0,
      unit: '人次'
    }
  ],
]

let yearIndexArray = [
  [
    {
      title: '年度客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '日均客流量',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '双休日对工作日增长率',
      value: 0,
      unit: '人次'
    },
    {
      title: '去年同期',
      value: 0,
      unit: '人次'
    }
  ],
]

let dayMallArray = [
  [
    {
      title: '当日客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '有效客流',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '昨日客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '上周同期',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '去年同期',
      value: 0,
      unit: '人次'
    },
    {
      title: '门店面积',
      value: 0,
      unit: '平米'
    }
  ],
]

let weekMallArray = [
  [
    {
      title: '本周客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '有效客流',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '日均客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '上周同期',
      value: 0,
      unit: '平米'
    }
  ],
]

let monthMallArray = [
  [
    {
      title: '本月客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '有效客流',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '日均客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '上月同期',
      value: 0,
      unit: '平米'
    }
  ],
]

let yearMallArray = [
  [
    {
      title: '年度客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '有效客流',
      value: 0,
      unit: '人次'
    },
  ],
  [
    {
      title: '日均客流',
      value: 0,
      unit: '人次'
    },
    {
      title: '工作日平均客流量',
      value: 0,
      unit: '人次'
    }
  ],
  [
    {
      title: '双休日平均客流量',
      value: 0,
      unit: '人次'
    },
    {
      title: '去年同期',
      value: 0,
      unit: '平米'
    }
  ],
]

const echartInfo = {
  tooltip: {
    show: true,
    padding:[5,15],
    position: function(pos, params, dom, rect, size){
      let obj={};
      if (pos[0] + size.contentSize[0] > size.viewSize[0]){
        obj['right'] = size.viewSize[0] - pos[0]
      } else {
        obj['left'] = pos[0]
      }
      if(pos[1] + size.contentSize[1] > size.viewSize[1]){
        obj['bottom'] = size.viewSize[1] - pos[1]
      }else{
        obj['top'] = pos[1]
      }
        return obj;
    }
  },
  legend: {
    textStyle: {
      fontSize: 11,
      fontWeight: 400,
      color: "#8C8C8C"
    }
  },
  color1: ["#3BB7FF", "#FFC62E", "#CCCCCC"],
  grid: {
    right: 10,
    left: 10,
    top: 30,
    borderColor: "transparent",
    bottom: 0,
    containLabel: true,
  },
  xAxis: {
    axisLine: {
      width: 1,
      lineStyle: {
          color: "#EEEEEE",
      }
    },
    axisLabel: {
      align: "right",
      rotate: 0, // x轴label旋转角度
      margin: 10,
      color: "rgba(0, 0, 0, 0.45)",
      fontFamily: 'GenShinGothic-Monospace-Regular',
      fontSize: 11,
      lineHeight: 12
    }
  }
}

module.exports = {
  dayIndexArray,
  weekIndexArray,
  monthIndexArray,
  yearIndexArray,
  dayMallArray,
  weekMallArray,
  monthMallArray,
  yearMallArray,
  echartInfo
}