增加占位组件

This commit is contained in:
yulixing 2019-07-29 18:03:12 +08:00
parent 6fad3f7488
commit 6eff58c91a
3 changed files with 49 additions and 12 deletions

View File

@ -0,0 +1,24 @@
<template>
<div class="placeholder">
<svg-icon
class="icon-empty"
icon-class="box-empty"
/>
<span>暂无数据</span>
</div>
</template>
<style lang="scss" scoped>
.placeholder {
padding: 30px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 24px;
text-align: center;
color: #606266;
}
</style>

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1564391549289" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4284" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M490.644111 645.511783c-2.940982-1.000793-6.182816-0.007163-8.072863 2.463098l-52.761668 68.923766c-3.083222 4.019547-7.961322 6.4192-13.047154 6.4192-2.860141 0-5.672186-0.73985-8.144494-2.162246L166.880263 583.199599c-2.240017-1.279133-5.006014-1.269923-7.230682 0.031722-2.240017 1.287319-3.607154 3.678786-3.607154 6.261611l0 107.602693c0 2.589988 1.3743 4.981455 3.615341 6.277984l325.034794 188.047864c1.12052 0.650823 2.376117 0.975211 3.631714 0.975211 1.246387 0 2.494821-0.324388 3.623527-0.967024 2.241041-1.296529 3.623527-3.696182 3.623527-6.277984L495.571331 652.376121C495.570307 649.27141 493.58407 646.511553 490.644111 645.511783z" p-id="4285"></path><path d="M864.338139 583.231321c-2.223644-1.301645-4.981455-1.310855-7.230682-0.031722L615.354438 721.172997c-2.453888 1.404999-5.260817 2.14485-8.120958 2.14485-5.094018 0-9.972119-2.391467-13.047154-6.412037l-52.761668-68.930929c-1.89107-2.470261-5.14109-3.463891-8.080026-2.463098-2.939959 1.000793-4.919033 3.759627-4.919033 6.864338l0 232.776577c0 2.580778 1.375324 4.981455 3.623527 6.277984 1.12052 0.642636 2.366907 0.967024 3.622504 0.967024 1.248434 0 2.503007-0.324388 3.623527-0.975211l325.034794-188.047864c2.241041-1.296529 3.615341-3.687996 3.615341-6.277984L867.945293 589.493955C867.946316 586.910107 866.572016 584.51864 864.338139 583.231321z" p-id="4286"></path><path d="M960.237279 288.992927c-0.38988-2.347464-1.907443-4.358261-4.060479-5.374404L628.980783 129.280412c-2.622734-1.232061-5.728468-0.791016-7.897877 1.128707l-93.516884 82.755796-12.17939-6.460132c-2.122337-1.131777-4.671393-1.131777-6.79373 0l-12.181437 6.464225-93.499487-82.760912c-2.169409-1.918699-5.26798-2.359744-7.889691-1.128707L67.819107 283.617499c-2.15406 1.016143-3.671623 3.02694-4.061502 5.374404-0.381693 2.344395 0.405229 4.735861 2.113127 6.388501l97.639784 94.384647-15.382339 8.169053c-1.216711 0.642636-2.225691 1.62808-2.90926 2.828418l-53.029774 93.649913c-1.962701 3.476171-0.748037 7.886621 2.716878 9.864672l312.042899 178.109514c3.146667 1.804089 7.142677 0.994654 9.344832-1.88186l65.934688-86.11838c1.280156-1.683339 1.772366-3.830235 1.343601-5.895267-0.436952-2.066055-1.747807-3.845585-3.599991-4.862751L170.209078 412.95624l329.984526-175.098947 0.00921 215.297484-81.009012 46.944172c-2.257413 1.307785-3.638877 3.734044-3.616364 6.345522 0.032746 2.613524 1.462305 5.004991 3.751441 6.268774l89.161692 49.14121c2.176572 1.208525 4.814656 1.208525 7.000438 0l89.168856-49.14121c2.288113-1.263783 3.718695-3.65525 3.750417-6.272867 0.023536-2.610454-1.350764-5.03262-3.615341-6.340405l-81.009012-46.944172 0.008186-215.301578 329.984526 175.10304L544.016693 583.629387c-1.853208 1.017166-3.163039 2.796696-3.599991 4.862751-0.429789 2.065032 0.056282 4.211928 1.342578 5.895267l65.936735 86.11838c1.413186 1.843998 3.567245 2.835581 5.760191 2.835581 1.222851 0 2.463098-0.310062 3.583618-0.954745L929.080675 504.278131c3.474125-1.978051 4.689812-6.388501 2.717901-9.864672l-53.038984-93.654007c-0.682545-1.199315-1.691525-2.180666-2.907213-2.824325l-15.359826-8.169053 97.630574-94.384647C959.833073 293.728788 960.626135 291.336298 960.237279 288.992927z" p-id="4287"></path></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,13 +1,16 @@
<template> <template>
<div class="main-content"> <div class="main-content">
<!-- 筛选 --> <!-- filter -->
<el-row :gutter="32"> <el-form
<el-col :span="6"> :inline="true"
class="filter"
>
<el-form-item label="平台">
<el-select <el-select
v-model="platform_id" v-model="platform_id"
@change="changePlatform" @change="changePlatform"
placeholder="请选择平台" placeholder="请选择平台"
class="w100 mgb-20" class="w100"
> >
<el-option <el-option
v-for="item in platformsArr" v-for="item in platformsArr"
@ -16,8 +19,8 @@
:value="item.platform.platform_id" :value="item.platform.platform_id"
/> />
</el-select> </el-select>
</el-col> </el-form-item>
<el-col :span="6"> <el-form-item label="日期">
<el-date-picker <el-date-picker
v-model="date" v-model="date"
align="right" align="right"
@ -28,13 +31,13 @@
@change="changeDate" @change="changeDate"
> >
</el-date-picker> </el-date-picker>
</el-col> </el-form-item>
<el-col :span="6"> <el-form-item label="用户类型">
<el-select <el-select
v-model="isNew" v-model="isNew"
@change="changeNew" @change="changeNew"
placeholder="是否当日新用户" placeholder="是否当日新用户"
class="w100 mgb-20" class="w100"
> >
<el-option <el-option
label="非当日新用户" label="非当日新用户"
@ -45,9 +48,13 @@
:value="1" :value="1"
/> />
</el-select> </el-select>
</el-col> </el-form-item>
</el-row> </el-form>
<!-- 筛选 end --> <!-- filter end -->
<!-- 占位 -->
<placeholder v-if="JSON.stringify(reportData) === '{}'" />
<!-- 占位 end -->
<!-- 数据面板 --> <!-- 数据面板 -->
<div class="data-panel"> <div class="data-panel">
@ -86,6 +93,7 @@ import { getReport } from '@/api/data'
import getPageTitle from '@/utils/get-page-title' import getPageTitle from '@/utils/get-page-title'
import { reject, Promise } from 'q' import { reject, Promise } from 'q'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import Placeholder from '@/components/Placeholder'
export default { export default {
name: 'GameDetailsData', name: 'GameDetailsData',
@ -104,6 +112,9 @@ export default {
reportData: {} reportData: {}
} }
}, },
components: {
Placeholder
},
computed: { computed: {
...mapGetters(['userInfo']) ...mapGetters(['userInfo'])
}, },
@ -173,6 +184,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.reportData = {}
console.log(err) console.log(err)
}) })
}, },