TaskCard.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div :class="prefixCls">
  3. <div :class="`${prefixCls}-header`">
  4. <div :class="`${prefixCls}__info`">
  5. <span :class="`${prefixCls}__title`">{{ info.title }}</span>
  6. <span :class="`${prefixCls}__desc`">{{ info.desc }}</span>
  7. </div>
  8. <span :class="`${prefixCls}__tag ${info.status}`">{{ info.text }}</span>
  9. </div>
  10. <div :class="`${prefixCls}-body mt-5`">
  11. <div :class="`${prefixCls}__process-nfo`">
  12. <span>进度</span>
  13. <span>{{ info.percent }}%</span>
  14. </div>
  15. <Progress :percent="info.percent" :showInfo="false" :status="info.status" />
  16. </div>
  17. <div :class="`${prefixCls}-footer`">
  18. <span :class="`${prefixCls}__date`">
  19. 更新日期: <span>{{ info.updateTime }}</span>
  20. </span>
  21. <div :class="`${prefixCls}__avatar`">
  22. <Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
  23. <Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
  24. <Avatar>+3</Avatar>
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script lang="ts">
  30. import { computed, defineComponent, PropType } from 'vue';
  31. import { Progress, Avatar } from 'ant-design-vue';
  32. import { TaskItem } from '../types';
  33. export default defineComponent({
  34. name: 'GrowCard',
  35. components: { Progress, Avatar },
  36. props: {
  37. info: {
  38. type: Object as PropType<TaskItem>,
  39. default: null,
  40. },
  41. },
  42. setup(props) {
  43. return {
  44. prefixCls: 'task-card',
  45. text: computed(() => {
  46. const { status } = props.info || {};
  47. return status === 'active'
  48. ? '进度正常'
  49. : status === 'exception'
  50. ? '进度滞后'
  51. : '项目完成';
  52. }),
  53. };
  54. },
  55. });
  56. </script>
  57. <style lang="less" scoped>
  58. .task-card {
  59. display: flex;
  60. width: calc(100% - 24px);
  61. height: 199px;
  62. padding: 24px 20px 12px 16px;
  63. margin: 0 12px 12px 12px;
  64. background: #fff;
  65. border: 1px solid #ececf2;
  66. border-radius: 12px;
  67. flex-direction: column;
  68. &-header {
  69. display: flex;
  70. width: 100%;
  71. justify-content: space-between;
  72. align-items: center;
  73. }
  74. &__tag {
  75. display: inline-block;
  76. padding: 4px 6px;
  77. font-family: PingFangSC-Regular;
  78. font-size: 12px;
  79. border-radius: 6px;
  80. &.success {
  81. color: #55d187;
  82. background: rgba(85, 209, 135, 0.16);
  83. }
  84. &.warn {
  85. color: #ffa07d;
  86. background: #ffd16416;
  87. }
  88. &.done {
  89. color: #0593ff;
  90. background: #0593ff16;
  91. }
  92. }
  93. &__info {
  94. display: flex;
  95. flex-direction: column;
  96. }
  97. &__title {
  98. font-family: PingFangSC-Medium;
  99. font-size: 16px;
  100. line-height: 24px;
  101. color: rgba(0, 0, 0, 0.85);
  102. }
  103. &__desc {
  104. font-family: PingFangSC-Regular;
  105. font-size: 12px;
  106. line-height: 21px;
  107. color: #8181a5;
  108. }
  109. &__process-nfo {
  110. display: flex;
  111. justify-content: space-between;
  112. span {
  113. font-size: 14px;
  114. line-height: 21px;
  115. color: #8181a5;
  116. }
  117. }
  118. &-footer {
  119. display: flex;
  120. width: 100%;
  121. margin-top: 16px;
  122. align-items: center;
  123. justify-content: space-between;
  124. }
  125. &__date {
  126. font-size: 12px;
  127. line-height: 21px;
  128. color: #2c3a61;
  129. span {
  130. color: #7c8087;
  131. }
  132. }
  133. &__avatar {
  134. display: flex;
  135. }
  136. }
  137. </style>