farmTable.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="farm-table">
  3. <div class="th">
  4. <div class="td">农事名称</div>
  5. <div class="td">农事配方</div>
  6. <div class="td">服务主体</div>
  7. <div class="td">认证类型</div>
  8. </div>
  9. <div class="tr-wrap" v-if="tableData&&tableData?.length">
  10. <div class="tr" v-for="(item,index) in tableData.slice(0,4)" :key="index">
  11. <div class="td">{{item.farmWorkLibName}}</div>
  12. <div class="td">{{item.shortName}}</div>
  13. <!-- <div class="td width">
  14. <div v-for="(ele,idx) in item.prescriptionObj" :key="idx">{{ele.name}}</div>
  15. </div> -->
  16. <div class="td">{{item.nzName}}</div>
  17. <div class="td">{{item.standard}}</div>
  18. </div>
  19. </div>
  20. <div v-else class="empty">暂无数据</div>
  21. </div>
  22. </template>
  23. <script setup>
  24. const props = defineProps({
  25. tableData:{
  26. type:Array,
  27. defalut:[]
  28. }
  29. })
  30. </script>
  31. <style lang="scss" scoped>
  32. .farm-table {
  33. margin-top: 8px;
  34. width: 100%;
  35. overflow: hidden;
  36. border: 1px solid rgba(0, 0, 0, 0.2);
  37. border-radius: 8px;
  38. font-size: 12px;
  39. color: #999999;
  40. .th {
  41. display: flex;
  42. justify-content: space-between;
  43. background: #f2f2f2;
  44. border-radius: 8px 8px 0 0;
  45. padding: 11px 5px;
  46. font-size: 13px;
  47. .td {
  48. width: 25%;
  49. text-align: center;
  50. }
  51. }
  52. .tr {
  53. display: flex;
  54. align-items: center;
  55. padding: 11px 5px;
  56. .td {
  57. width: 25%;
  58. text-align: center;
  59. }
  60. }
  61. .tr + .tr {
  62. border-top: 1px solid rgba(0, 0, 0, 0.2);
  63. }
  64. .width{
  65. width: 30% !important;
  66. }
  67. .empty{
  68. height: 100px;
  69. line-height: 100px;
  70. text-align: center;
  71. }
  72. }
  73. </style>