|
@@ -0,0 +1,163 @@
|
|
|
+<template>
|
|
|
+ <div class="data-report">
|
|
|
+ <ListCard
|
|
|
+ class="report-card report-week"
|
|
|
+ title="周报"
|
|
|
+ :list="weekList"
|
|
|
+ @linkMore="linkMore('week')"
|
|
|
+ :loading="loading"
|
|
|
+ :loaded="loaded">
|
|
|
+ <div class="report-content">
|
|
|
+ <div
|
|
|
+ class="report-item"
|
|
|
+ v-for="(item, index) in weekList"
|
|
|
+ :key="index">
|
|
|
+ <div class="report-left" @click="clickListItem('week', item)">
|
|
|
+ <span class="report-round main">周</span>
|
|
|
+ <span class="report-title">{{ dateFormatter(item.startdate * 1000, 'MM月dd日')}}-{{ dateFormatter(item.enddate * 1000, 'MM月dd日')}}</span>
|
|
|
+ <span class="red-dot" v-if="item.unread && item.unread !== 0"></span>
|
|
|
+ </div>
|
|
|
+ <div class="report-right r-time" v-if="item.pushtime">{{dateFormatter(item.pushtime * 1000, 'yyyy/MM/dd')}}</div>
|
|
|
+ </div>
|
|
|
+ <Empty
|
|
|
+ images=""
|
|
|
+ :mtb60="false"
|
|
|
+ direction="row"
|
|
|
+ v-if="emptyWeekShow">本周结束后,将为您推送周报,敬请期待~</Empty>
|
|
|
+ </div>
|
|
|
+ </ListCard>
|
|
|
+ <ListCard
|
|
|
+ class="report-card report-month"
|
|
|
+ title="月报"
|
|
|
+ :list="monthList"
|
|
|
+ @linkMore="linkMore('month')"
|
|
|
+ :loading="loading"
|
|
|
+ :loaded="loaded">
|
|
|
+ <div class="report-content">
|
|
|
+ <div
|
|
|
+ class="report-item"
|
|
|
+ v-for="(item, index) in monthList"
|
|
|
+ :key="index">
|
|
|
+ <div class="report-left" @click="clickListItem('month', item)">
|
|
|
+ <span class="report-round yellow">月</span>
|
|
|
+ <span class="report-title">{{dateFormatter(item.startdate * 1000, 'MM月dd日')}}-{{dateFormatter(item.enddate * 1000, 'MM月dd日')}}</span>
|
|
|
+ <span class="red-dot" v-if="item.unread && item.unread !== 0"></span>
|
|
|
+ </div>
|
|
|
+ <div class="report-right r-time" v-if="item.pushtime">{{dateFormatter(item.pushtime * 1000, 'yyyy/MM/dd')}}</div>
|
|
|
+ </div>
|
|
|
+ <Empty
|
|
|
+ images=""
|
|
|
+ :mtb60="false"
|
|
|
+ direction="row"
|
|
|
+ v-if="emptyMonthShow">本月结束后,将为您推送月报,敬请期待~~</Empty>
|
|
|
+ </div>
|
|
|
+ </ListCard>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, mapActions } from 'vuex'
|
|
|
+import ListCard from './ListCard'
|
|
|
+import Empty from '@/components/common/Empty.vue'
|
|
|
+import { dateFormatter } from '@/utils/'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'DataReport',
|
|
|
+ components: {
|
|
|
+ Empty,
|
|
|
+ ListCard
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ emptyWeekShow () {
|
|
|
+ return this.loaded && this.weekList.length === 0
|
|
|
+ },
|
|
|
+ emptyMonthShow () {
|
|
|
+ return this.loaded && this.monthList.length === 0
|
|
|
+ },
|
|
|
+ ...mapState({
|
|
|
+ loading: state => state.workspace.dataReport.loading,
|
|
|
+ loaded: state => state.workspace.dataReport.loaded,
|
|
|
+ weekList: state => state.workspace.dataReport.weekList,
|
|
|
+ monthList: state => state.workspace.dataReport.monthList
|
|
|
+ })
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ dateFormatter,
|
|
|
+ ...mapActions('workspace/dataReport', [
|
|
|
+ 'getList'
|
|
|
+ ]),
|
|
|
+ resolveLink (link) {
|
|
|
+ const { href } = this.$router.resolve(link)
|
|
|
+ return href
|
|
|
+ },
|
|
|
+ clickListItem (type, item) {
|
|
|
+ if (type === 'week') {
|
|
|
+ window.open(this.resolveLink(`/bigvip_subreport_week?start=${item.startdate}&end=${item.enddate}`))
|
|
|
+ } else if (type === 'month') {
|
|
|
+ window.open(this.resolveLink(`/bigvip_subreport_month?start=${item.startdate}&end=${item.enddate}`))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ linkMore (type) {
|
|
|
+ if (type === 'week') {
|
|
|
+ window.open(this.resolveLink('/bigvip_subreport_week'))
|
|
|
+ } else if (type === 'month') {
|
|
|
+ window.open(this.resolveLink('/bigvip_subreport_month'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep {
|
|
|
+ .list-container {
|
|
|
+ min-height: unset;
|
|
|
+ }
|
|
|
+ .empty-container {
|
|
|
+ margin-top: -8px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.data-report {
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.report-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 12px 0;
|
|
|
+}
|
|
|
+.report-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.report-title {
|
|
|
+ margin: 0 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #1D1D1D;
|
|
|
+ line-height: 22px;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ color: #2cb7ca;
|
|
|
+ }
|
|
|
+}
|
|
|
+.report-round {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 50%;
|
|
|
+ &.main {
|
|
|
+ background-color: #2cb7ca;
|
|
|
+ }
|
|
|
+ &.yellow {
|
|
|
+ background-color: #ff9f40;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|