IndexChart.vue 9.9 KB
Newer Older
何忠建's avatar
何忠建 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<template>
  <div class="page-header-index-wide">
    <div class="query-box">
      <a-range-picker @change="onChangeData" />
      <a-button type="primary" @click="searchQuery" style="margin-left: 20px;">查询</a-button>
    </div>
    <div class="data-box">
      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">绑定商铺数量</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">100</p>
      </div>
      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">平台总小区数量</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">100</p>
      </div>

      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">平台总业主数量</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">100</p>
      </div>

      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">合作伙伴分利</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">¥100.00</p>
      </div>

      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">新增订单数量</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">100</p>
      </div>
      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">总营收</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">¥100.00</p>
      </div>
      <div class="statistics">
        <p style="color:#666;margin-bottom:5px;">本月营收</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">¥100.00</p>
      </div>
      <div class="statistics" style="margin-right: 0;">
        <p style="color:#666;margin-bottom:5px;">今日营收</p>
        <p style="margin-bottom:0;color:#333;font-size:24px;line-height:1;">¥100.00</p>
      </div>
    </div>
    <a-row :gutter="24">
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">最新成交订单</h3>
          <div class="order">
何忠建's avatar
何忠建 committed
49 50
            <div class="order-title"><span
                style="width: 30%;">订单编号</span><span>提交时间</span><span>用户账号</span><span>订单金额</span></div>
何忠建's avatar
何忠建 committed
51 52
            <vue-seamless-scroll :data="listData" class="seamless-warp" :class-option="defineScroll">
              <div v-for="(item, index) in listData" :key="index" class="item">
何忠建's avatar
何忠建 committed
53 54
                <span
                  style="width: 30%;">{{ item.num }}</span><span>{{ item.date }}</span><span>{{ item.account }}</span><span>{{ item.amount }}</span>
何忠建's avatar
何忠建 committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
              </div>
            </vue-seamless-scroll>
          </div>
        </div>
      </a-col>
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">月成交金额</h3>
          <line-chart-multid :dataSource="dayData" :fields="dayFields" style="padding: 0;" />
        </div>
      </a-col>
    </a-row>
    <a-row :gutter="24">
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">月成交订单数量</h3>
          <div>
            <line-chart-multid :dataSource="dayData" :fields="dayFields" style="padding: 0;" />
          </div>
        </div>
      </a-col>
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">入驻商铺新增数量</h3>
          <bar :dataSource="barData" style="padding: 0;" />
        </div>
      </a-col>
    </a-row>
何忠建's avatar
何忠建 committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    <a-row :gutter="24">
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">巡报订单数量</h3>
          <div>
            <line-chart-multid :dataSource="dayData1" :fields="dayFields1" style="padding: 0;" />
          </div>
        </div>
      </a-col>
      <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '20px' }">
        <div class="t-box">
          <h3 class="box-title">巡报订单金额</h3>
          <line-chart-multid :dataSource="dayData1" :fields="dayFields1" style="padding: 0;" />
        </div>
      </a-col>
    </a-row>
何忠建's avatar
何忠建 committed
99 100 101 102 103 104 105 106 107
  </div>
</template>

<script>
import Bar from '@/components/chart/Bar'
import LineChartMultid from '@/components/chart/LineChartMultid'
import vueSeamlessScroll from 'vue-seamless-scroll'
import { getDataStatisticsApi, getLoginfo, getVisitInfo, auditPropertyApi } from '@/api/api'
export default {
何忠建's avatar
何忠建 committed
108
  name: 'statistical',
何忠建's avatar
何忠建 committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
  components: {
    Bar,
    LineChartMultid,
    vueSeamlessScroll,
  },
  data() {
    return {
      loading: true,
      payData: [],
      barData: [],
      dayFields: ['月成交订单数量'],
      dayData: [
        { type: '1月', 月成交订单数量: 71 },
        { type: '2月', 月成交订单数量: 61.9 },
        { type: '3月', 月成交订单数量: 19.5 },
        { type: '4月', 月成交订单数量: 141.5 },
        { type: '5月', 月成交订单数量: 118.4 },
        { type: '6月', 月成交订单数量: 211.5 },
        { type: '7月', 月成交订单数量: 251.2 },
        { type: '8月', 月成交订单数量: 216.5 },
        { type: '9月', 月成交订单数量: 213.3 },
        { type: '10月', 月成交订单数量: 181.3 },
        { type: '11月', 月成交订单数量: 131.9 },
        { type: '12月', 月成交订单数量: 91.6 },
      ],
      listData: [
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
        {
          num: '201707196398345',
          date: '2023-07-19',
          account: '18000000000',
          amount: '¥200.00',
        },
      ],
何忠建's avatar
何忠建 committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197
      dayFields1: ['巡报订单数量'],
      dayFields2: ['巡报订单金额'],
      dayData1: [
        { type: '7月1日', 巡报订单数量: 171 },
        { type: '7月10日', 巡报订单数量: 161.9 },
        { type: '7月20日', 巡报订单数量: 119.5 },
        { type: '7月30日', 巡报订单数量: 141.5 },
        { type: '8月10日', 巡报订单数量: 118.4 },
        { type: '8月20日', 巡报订单数量: 211.5 },
        { type: '8月30日', 巡报订单数量: 251.2 },
        { type: '9月10日', 巡报订单数量: 216.5 },
        { type: '9月20日', 巡报订单数量: 213.3 },
        { type: '9月30日', 巡报订单数量: 81.3 },
      ],
何忠建's avatar
何忠建 committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
    }
  },
  created() {
    setTimeout(() => {
      this.loading = !this.loading
    }, 1000)
    for (let i = 0; i < 12; i += 1) {
      this.barData.push({
        x: `${i + 1}月`,
        y: i + 10,
      })
    }
  },
  computed: {
    defineScroll() {
      return {
        step: 0.5, // 数值越大速度滚动越快
        limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
      }
    },
  },
  methods: {
    onChangeData(date, dateString) {
      if (dateString.length > 0) {
        this.queryParam.createTime_begin = dateString[0]
        this.queryParam.createTime_end = dateString[1]
      } else {
        this.queryParam.createTime_begin = ''
        this.queryParam.createTime_end = ''
      }
    },
    searchQuery() {},
  },
}
</script>

<style lang="less" scoped>
.page-header-index-wide {
  padding: 16px;

  .query-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
  }
  .data-box {
    display: flex;
    margin-bottom: 20px;
    justify-content: space-between;
  }
  .statistics {
    background: #fff;
    width: 11.5%;
    box-sizing: border-box;
    border: 1px solid #e0dfdf;
    padding: 25px 10px;
    max-height: 100px;
    text-align: center;
  }
}
.t-box {
  background: #fff;
  padding: 15px;
  border: 1px solid #e0dfdf;
  height: 340px;
}
.box-title {
  font-weight: bold;
  margin-bottom: 15px;
  display: inline-block;
  padding-left: 10px;
  border-left: 3px solid #1890ff;
  height: 20px;
  line-height: 20px;
}
.order {
  margin: 0 10px;
  .order-title {
    background: #fafafa;
    height: 40px;
    line-height: 40px;
    display: flex;
    border-left: 1px solid #e8e8e8;
    span {
      width: 25%;
      border-right: 1px solid #e8e8e8;
      border-top: 1px solid #e8e8e8;
      text-align: center;
      font-weight: bold;
    }
  }
  .seamless-warp {
    border: 1px solid #e8e8e8;
    border-right: none;
    .item {
      height: 40px;
      line-height: 40px;
      display: flex;
      span {
        width: 25%;
        border-right: 1px solid #e8e8e8;
        border-top: 1px solid #e8e8e8;
        text-align: center;
      }
    }
  }
}
.seamless-warp {
  height: 220px;
  overflow: hidden;
}
</style>