PanelGroup.vue 5.29 KB
Newer Older
sunhongwei's avatar
sunhongwei committed
1
<template>
dragondean@qq.com's avatar
dragondean@qq.com committed
2
  <el-row :gutter="40" class="panel-group" v-if="data">
sunhongwei's avatar
sunhongwei committed
3
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
4
      <div class="card-panel" @click="checkPermi(['member:user']) ? $router.push('/member/member-user') : $alert($t('暂无权限'))">
sunhongwei's avatar
sunhongwei committed
5 6 7 8 9
        <div class="card-panel-icon-wrapper icon-people">
          <svg-icon icon-class="peoples" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
dragondean@qq.com's avatar
dragondean@qq.com committed
10
            {{$t('注册会员数')}}
sunhongwei's avatar
sunhongwei committed
11
          </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
12
          <count-to :start-val="0" :end-val="data.memberCount" :duration="2600" class="card-panel-num" />
sunhongwei's avatar
sunhongwei committed
13 14 15 16
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
17
      <div class="card-panel" @click="$router.push('/system/internalMessage/my-internal-message?status=0')">
sunhongwei's avatar
sunhongwei committed
18 19 20 21 22
        <div class="card-panel-icon-wrapper icon-message">
          <svg-icon icon-class="message" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
dragondean@qq.com's avatar
dragondean@qq.com committed
23
            {{$t('未读消息数')}}
sunhongwei's avatar
sunhongwei committed
24
          </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
25
          <count-to :start-val="0" :end-val="data.messageCount" :duration="3000" class="card-panel-num" />
sunhongwei's avatar
sunhongwei committed
26 27 28 29
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
30
      <div class="card-panel" @click="$router.push('/task/todo')">
sunhongwei's avatar
sunhongwei committed
31
        <div class="card-panel-icon-wrapper icon-money">
dragondean@qq.com's avatar
dragondean@qq.com committed
32
          <svg-icon icon-class="date" class-name="card-panel-icon" />
sunhongwei's avatar
sunhongwei committed
33 34 35
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
dragondean@qq.com's avatar
dragondean@qq.com committed
36
            {{$t('待办事项')}}
sunhongwei's avatar
sunhongwei committed
37
          </div>
38
          <count-to :start-val="0" :end-val="todoCount" :duration="3200" class="card-panel-num" />
sunhongwei's avatar
sunhongwei committed
39 40 41 42
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
43
      <div class="card-panel" @click="$router.push('/order/mine')">
sunhongwei's avatar
sunhongwei committed
44 45 46 47 48
        <div class="card-panel-icon-wrapper icon-shopping">
          <svg-icon icon-class="shopping" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
dragondean@qq.com's avatar
dragondean@qq.com committed
49
            {{$t('我的订单')}}
sunhongwei's avatar
sunhongwei committed
50
          </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
51
          <count-to :start-val="0" :end-val="data.orderCount" :duration="3600" class="card-panel-num" />
sunhongwei's avatar
sunhongwei committed
52 53 54
        </div>
      </div>
    </el-col>
55 56 57 58 59 60 61 62 63 64 65 66 67
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="$router.push('/member/member/under-review')">
        <div class="card-panel-icon-wrapper icon-shopping">
          <svg-icon icon-class="time-range" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            {{$t('待审核注册会员')}}
          </div>
          <count-to :start-val="0" :end-val="data.reviewMemberCount" :duration="3600" class="card-panel-num" />
        </div>
      </div>
    </el-col>
sunhongwei's avatar
sunhongwei committed
68 69 70 71 72
  </el-row>
</template>

<script>
import CountTo from 'vue-count-to'
dragondean@qq.com's avatar
dragondean@qq.com committed
73
import {panelData} from '@/api/system/pannel'
74
import {checkPermi} from '@/utils/permission'
75
import {taskTodoCount} from '@/api/bpm/task'
sunhongwei's avatar
sunhongwei committed
76 77 78 79
export default {
  components: {
    CountTo
  },
dragondean@qq.com's avatar
dragondean@qq.com committed
80 81
  data(){
    return {
82 83
      data: null,
      todoCount: 0
dragondean@qq.com's avatar
dragondean@qq.com committed
84 85
    }
  },
sunhongwei's avatar
sunhongwei committed
86 87 88
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
89 90
    },
    checkPermi
dragondean@qq.com's avatar
dragondean@qq.com committed
91 92 93 94 95
  },
  created(){
    panelData().then(res => {
      this.data = res.data
    })
96 97 98
    taskTodoCount().then(res => {
      this.todoCount = res.data
    })
sunhongwei's avatar
sunhongwei committed
99 100 101 102 103 104 105 106 107 108 109 110 111
  }
}
</script>

<style lang="scss" scoped>
.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
黄卓's avatar
黄卓 committed
112 113
    display: flex;
    justify-content: space-between;
sunhongwei's avatar
sunhongwei committed
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      font-size: 48px;
    }

    .card-panel-description {
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}

@media (max-width:550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>