quality-inspection.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <div class="list-wrap">
  3. <a-typography-title class="block-title" :heading="6">
  4. {{ $t('cardList.tab.title.content') }}
  5. </a-typography-title>
  6. <a-row class="list-row" :gutter="24">
  7. <a-col
  8. :xs="12"
  9. :sm="12"
  10. :md="12"
  11. :lg="6"
  12. :xl="6"
  13. :xxl="6"
  14. class="list-col"
  15. >
  16. <div class="card-wrap empty-wrap">
  17. <a-card :bordered="false" hoverable>
  18. <a-result :status="null" :title="$t('cardList.content.action')">
  19. <template #icon>
  20. <icon-plus style="font-size: 20px" />
  21. </template>
  22. </a-result>
  23. </a-card>
  24. </div>
  25. </a-col>
  26. <a-col
  27. v-for="item in renderData"
  28. :key="item.id"
  29. class="list-col"
  30. :xs="12"
  31. :sm="12"
  32. :md="12"
  33. :lg="6"
  34. :xl="6"
  35. :xxl="6"
  36. >
  37. <CardWrap
  38. :loading="loading"
  39. :title="item.title"
  40. :description="item.description"
  41. :default-value="item.enable"
  42. :action-type="item.actionType"
  43. :icon="item.icon"
  44. :open-txt="$t('cardList.content.inspection')"
  45. :close-txt="$t('cardList.content.delete')"
  46. :show-tag="false"
  47. >
  48. <a-descriptions
  49. style="margin-top: 16px"
  50. :data="item.data"
  51. layout="inline-horizontal"
  52. :column="2"
  53. />
  54. <template #skeleton>
  55. <a-skeleton :animation="true">
  56. <a-skeleton-line
  57. :widths="['50%', '50%', '100%', '40%']"
  58. :rows="4"
  59. />
  60. <a-skeleton-line :widths="['40%']" :rows="1" />
  61. </a-skeleton>
  62. </template>
  63. </CardWrap>
  64. </a-col>
  65. </a-row>
  66. </div>
  67. </template>
  68. <script lang="ts" setup>
  69. import { queryInspectionList, ServiceRecord } from '@/api/list';
  70. import useRequest from '@/hooks/request';
  71. import CardWrap from './card-wrap.vue';
  72. const defaultValue: ServiceRecord[] = new Array(3).fill({});
  73. const { loading, response: renderData } = useRequest<ServiceRecord[]>(
  74. queryInspectionList,
  75. defaultValue
  76. );
  77. </script>
  78. <style scoped lang="less">
  79. .card-wrap {
  80. height: 100%;
  81. transition: all 0.3s;
  82. border: 1px solid var(--color-neutral-3);
  83. &:hover {
  84. transform: translateY(-4px);
  85. }
  86. :deep(.arco-card-meta-description) {
  87. color: rgb(var(--gray-6));
  88. .arco-descriptions-item-label-inline {
  89. font-weight: normal;
  90. font-size: 12px;
  91. color: rgb(var(--gray-6));
  92. }
  93. .arco-descriptions-item-value-inline {
  94. color: rgb(var(--gray-8));
  95. }
  96. }
  97. }
  98. .empty-wrap {
  99. height: 200px;
  100. border-radius: 4px;
  101. :deep(.arco-card) {
  102. height: 100%;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. border-radius: 4px;
  107. .arco-result-title {
  108. color: rgb(var(--gray-6));
  109. }
  110. }
  111. }
  112. </style>