FollowCard.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <ul class="follow_card">
  3. <li
  4. v-for="(item, index) in cardList"
  5. :key="item.id"
  6. class="audit_card"
  7. >
  8. <!-- 头部内容 -->
  9. <div class="card_header">
  10. <!-- 左侧基本信息 -->
  11. <div class="header_left">
  12. <span v-for="(titleItm,index) in item.headerTitleList" :key="index">{{ titleItm }}</span>
  13. <template v-if="item.headerTags?.length > 0">
  14. <el-tag v-for="(tag,index) in item.headerTags"
  15. :key="index"
  16. :disable-transitions="true"
  17. type="success" effect="light" size="small"
  18. class="status_tag">
  19. {{ tag }}
  20. </el-tag>
  21. </template>
  22. <span v-if="item.taskType" class="task_type">{{item.taskType}}</span>
  23. <span v-if="item.productType" class="product_type">{{item.productType}}</span>
  24. </div>
  25. <!-- 右侧操作信息 -->
  26. <div class="header_right">
  27. <slot name="operation" :row="item"></slot>
  28. </div>
  29. </div>
  30. <!-- 2. 中部描述信息-->
  31. <div v-if="item.middleDesc?.length > 0" class="card_info">
  32. <span v-for="(desc,index) in item.middleDesc" :key="index">{{ desc }}</span>
  33. </div>
  34. <!-- 3. 底部内容 -->
  35. <div class="card_content" >
  36. <span v-html="item?.bottomDesc"></span>
  37. </div>
  38. <slot name="additional" :row="item"></slot>
  39. </li>
  40. </ul>
  41. </template>
  42. <script setup lang="ts">
  43. interface AuditItm {
  44. id:string | number,
  45. headerTitleList:Array<string>,
  46. headerTags:Array<string>,
  47. taskType:string,
  48. productType:string,
  49. middleDesc:Array<string>,
  50. bottomDesc:string,
  51. }
  52. const props = defineProps({
  53. cardList:{
  54. type:Array<AuditItm>,
  55. required:true
  56. },
  57. })
  58. </script>
  59. <style lang="scss" scoped>
  60. .follow_card {
  61. display: flex;
  62. flex-direction: column;
  63. gap: 16px;
  64. .audit_card {
  65. border-radius: 8px 8px 8px 8px;
  66. border: 1px solid #EBEEF5;
  67. display: flex;
  68. flex-direction: column;
  69. gap:8px;
  70. /* 顶部布局 */
  71. .card_header{
  72. display: flex;
  73. justify-content: space-between;
  74. align-items: center;
  75. gap:10px;
  76. .header_left {
  77. display: flex;
  78. align-items: center;
  79. gap:8px;
  80. font-weight: 600;
  81. color: #333333;
  82. .status_tag {
  83. height: 25px;
  84. padding:0 8px;
  85. font-weight: 400;
  86. font-size: 12px;
  87. background: rgba(46,100,250,0.1);
  88. border-radius: 4px;
  89. color: #2E64FA;
  90. }
  91. .task_type{
  92. font-size: 12px;
  93. font-weight: 400;
  94. color:#fff;
  95. line-height: 17px;
  96. padding:4px 8px;
  97. background: #2E64FA;
  98. border-radius: 4px;
  99. }
  100. .product_type{
  101. padding:3px 8px;
  102. line-height: 18px;
  103. font-weight: 400;
  104. font-size: 12px;
  105. color: #2E64FA;
  106. border-radius:4px;
  107. border: 1px solid #2E64FA;
  108. }
  109. }
  110. .header_right{
  111. display: flex;
  112. gap:16px;
  113. .el-button{
  114. margin:0 !important;
  115. }
  116. }
  117. }
  118. /* 中部布局 */
  119. .card_info {
  120. display: flex;
  121. align-items: center;
  122. gap:11px;
  123. font-weight: 400;
  124. font-size: 12px;
  125. color: #333333;
  126. }
  127. /* 底部内容布局 */
  128. .card_content {
  129. font-weight: 400;
  130. font-size: 12px;
  131. color: #999999;
  132. }
  133. }
  134. }
  135. .follow_card{
  136. .audit_card{
  137. padding: 12px 16px;
  138. .header_left {
  139. font-size: 14px;
  140. }
  141. }
  142. }
  143. </style>