Vben
2021-04-07 5b8eb4a49a097a47caf491c44df427522ab58daa
src/views/dashboard/analysis/index.vue
@@ -1,83 +1,39 @@
<template>
  <div class="analysis p-4">
    <Row class="pl-2">
      <template v-for="item in growCardList" :key="item.title">
        <ACol :sm="24" :md="12" :lg="6">
          <GrowCard :info="item" />
        </ACol>
      </template>
    </Row>
  <div class="p-4">
    <GrowCard :loading="loading" class="enter-y" />
    <SiteAnalysis class="!my-4 enter-y" :loading="loading" />
    <Row>
      <ACol :md="24" :lg="17" class="my-3">
        <CollapseContainer class="mr-3" title="产品成交额" :canExpan="false">
          <AnalysisLine />
        </CollapseContainer>
        <Row class="mt-3">
          <ACol :md="24" :lg="12" class="product-total">
            <CollapseContainer class="mr-3" title="产品成交额" :canExpan="false">
              <AnalysisPie />
            </CollapseContainer>
          </ACol>
          <ACol :md="24" :lg="12">
            <CollapseContainer class="mr-3" title="用户来源" :canExpan="false">
              <AnalysisBar />
            </CollapseContainer>
          </ACol>
        </Row>
      </ACol>
      <ACol :md="24" :lg="7">
        <CollapseContainer class="mt-3" title="项目进度" :canExpan="false">
          <template v-for="item in taskList" :key="item.title">
            <TaskCard :info="item" />
          </template>
        </CollapseContainer>
      </ACol>
    </Row>
    <Row>
      <FlowAnalysis />
    </Row>
    <div class="md:flex enter-y">
      <VisitRadar class="md:w-1/3 w-full" :loading="loading" />
      <VisitSource class="md:w-1/3 !md:mx-4 !md:my-0 !my-4 w-full" :loading="loading" />
      <SalesProductPie class="md:w-1/3 w-full" :loading="loading" />
    </div>
  </div>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { defineComponent, ref } from 'vue';
  import GrowCard from './components/GrowCard.vue';
  import TrendLine from './components/TrendLine.vue';
  import AnalysisLine from './components/AnalysisLine.vue';
  import AnalysisPie from './components/AnalysisPie.vue';
  import AnalysisBar from './components/AnalysisBar.vue';
  import TaskCard from './components/TaskCard.vue';
  import FlowAnalysis from './components/FlowAnalysis';
  import { Row, Col } from 'ant-design-vue';
  import { CollapseContainer } from '/@/components/Container/index';
  import SiteAnalysis from './components/SiteAnalysis.vue';
  import VisitSource from './components/VisitSource.vue';
  import VisitRadar from './components/VisitRadar.vue';
  import SalesProductPie from './components/SalesProductPie.vue';
  import { growCardList, taskList } from './data';
  export default defineComponent({
    components: {
      Row,
      ACol: Col,
      GrowCard,
      CollapseContainer,
      TrendLine,
      AnalysisLine,
      AnalysisPie,
      AnalysisBar,
      TaskCard,
      FlowAnalysis,
      SiteAnalysis,
      VisitRadar,
      VisitSource,
      SalesProductPie,
    },
    setup() {
      return { growCardList, taskList };
      const loading = ref(true);
      setTimeout(() => {
        loading.value = false;
      }, 1500);
      return { loading };
    },
  });
</script>
<style lang="less" scoped>
  @import (reference) '../../../design/index.less';
  .analysis {
    width: 100%;
    .product-total {
      .respond-to(small-and-medium, {padding-right: 0;margin-bottom: 24px;});
    }
  }
</style>