index.vue 3.8 KB
Newer Older
陈小婷 已提交
1
<template>
2
  <PageWrapper :class="prefixCls" title="标准列表">
陈小婷 已提交
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
    <div :class="`${prefixCls}__top`">
      <a-row :gutter="12">
        <a-col :span="8" :class="`${prefixCls}__top-col`">
          <div>我的待办</div>
          <p>8个任务</p>
        </a-col>
        <a-col :span="8" :class="`${prefixCls}__top-col`">
          <div>本周任务平均处理时间</div>
          <p>32分钟</p>
        </a-col>
        <a-col :span="8" :class="`${prefixCls}__top-col`">
          <div>本周完成任务数</div>
          <p>24个任务</p>
        </a-col>
      </a-row>
    </div>

    <div :class="`${prefixCls}__content`">
      <a-list :pagination="pagination">
        <template v-for="item in list" :key="item.id">
          <a-list-item class="list">
            <a-list-item-meta>
              <template #avatar>
                <Icon class="icon" v-if="item.icon" :icon="item.icon" :color="item.color" />
              </template>
              <template #title>
                <span>{{ item.title }}</span>
                <div class="extra" v-if="item.extra">
                  {{ item.extra }}
                </div>
              </template>
              <template #description>
V
vben 已提交
35 36 37
                <div class="description">
                  {{ item.description }}
                </div>
陈小婷 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50
                <div class="info">
                  <div><span>Owner</span>{{ item.author }}</div>
                  <div><span>开始时间</span>{{ item.datetime }}</div>
                </div>
                <div class="progress">
                  <Progress :percent="item.percent" status="active" />
                </div>
              </template>
            </a-list-item-meta>
          </a-list-item>
        </template>
      </a-list>
    </div>
51
  </PageWrapper>
陈小婷 已提交
52 53
</template>
<script lang="ts">
54
  import { Progress, Row, Col, List } from 'ant-design-vue';
陈小婷 已提交
55
  import { defineComponent } from 'vue';
V
vben 已提交
56
  import { Icon } from '/@/components/Icon/index';
陈小婷 已提交
57
  import { cardList } from './data';
58
  import { PageWrapper } from '/@/components/Page';
陈小婷 已提交
59 60

  export default defineComponent({
V
vben 已提交
61 62 63 64 65 66 67 68 69 70
    components: {
      Icon,
      Progress,
      PageWrapper,
      [List.name]: List,
      [List.Item.name]: List.Item,
      AListItemMeta: List.Item.Meta,
      [Row.name]: Row,
      [Col.name]: Col,
    },
陈小婷 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
    setup() {
      return {
        prefixCls: 'list-basic',
        list: cardList,
        pagination: {
          show: true,
          pageSize: 3,
        },
      };
    },
  });
</script>
<style lang="less" scoped>
  .list-basic {
    &__top {
      padding: 24px;
V
Vben 已提交
87
      background-color: @component-background;
V
vben 已提交
88
      text-align: center;
陈小婷 已提交
89 90 91

      &-col {
        &:not(:last-child) {
V
Vben 已提交
92
          border-right: 1px dashed @border-color-base;
陈小婷 已提交
93 94 95 96
        }

        div {
          margin-bottom: 12px;
V
vben 已提交
97
          color: @text-color;
陈小婷 已提交
98 99 100 101 102 103
          font-size: 14px;
          line-height: 22px;
        }

        p {
          margin: 0;
V
vben 已提交
104
          color: @text-color;
陈小婷 已提交
105 106 107 108 109 110 111
          font-size: 24px;
          line-height: 32px;
        }
      }
    }

    &__content {
112
      margin-top: 12px;
V
vben 已提交
113
      padding: 24px;
V
Vben 已提交
114
      background-color: @component-background;
陈小婷 已提交
115 116 117 118 119 120 121 122 123 124 125 126 127

      .list {
        position: relative;
      }

      .icon {
        font-size: 40px !important;
      }

      .extra {
        position: absolute;
        top: 20px;
        right: 15px;
V
Vben 已提交
128
        color: @primary-color;
V
vben 已提交
129
        font-weight: normal;
陈小婷 已提交
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
        cursor: pointer;
      }

      .description {
        display: inline-block;
        width: 40%;
      }

      .info {
        display: inline-block;
        width: 30%;
        text-align: center;

        div {
          display: inline-block;
          padding: 0 20px;

          span {
            display: block;
          }
        }
      }

      .progress {
        display: inline-block;
        width: 15%;
        vertical-align: top;
      }
    }
  }
</style>