baseinfo.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="border-#AFDDBB pd-26 pb-10 pt-10 bg-#FBFDFB p-rtv">
  3. <!-- 关闭按钮 -->
  4. <view v-if="showClose" class="c-#F81242 f-s-36 ab2-10-10 pl-20 pr-10" style="position: absolute; right: 10rpx; top: 0rpx" @click="handleClose"> × </view>
  5. <!-- 标签显示:GAP和三无一全 -->
  6. <view v-if="+modeValue?.gapFlag || +modeValue?.swyqRes" class="pt-8 pb-8 d-flex pr-20 pl-20" style="width: max-content; margin-top: -10rpx; margin-left: -26rpx; background: linear-gradient(90deg, #5eba75, #c6e391); border-bottom-right-radius: 88rpx">
  7. <view v-if="+modeValue?.gapFlag && !+modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地</view>
  8. <view v-if="+modeValue?.swyqRes && !+modeValue?.gapFlag" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.swyqMedicineName }}三无一全基地</view>
  9. <view v-if="+modeValue?.gapFlag && +modeValue?.swyqRes" class="c-#fff f-s-24 f-w-6">获评{{ modeValue?.medicineName }}GAP基地和{{ modeValue?.swyqMedicineName }}三无一全基地</view>
  10. </view>
  11. <view class="c-#333 f-s-34 f-w-5 pt-8 pb-8 pr-16">{{ modeValue?.baseName }}</view>
  12. <view class="pt-8 pb-8">
  13. <text class="c-#666 f-s-28">基地面积:</text>
  14. <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.area }}{{ modeValue?.areaUnit }}</text>
  15. </view>
  16. <view class="pt-8 pb-8">
  17. <text class="c-#666 f-s-28">基地地址:</text>
  18. <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.adcodeName }}{{ modeValue?.address }}</text>
  19. </view>
  20. <view style="margin-left: -26rpx; margin-right: -26rpx; border-bottom: 1rpx solid #d4ecda"></view>
  21. <view class="pt-16 pb-8">
  22. <text v-if="+modeValue?.data?.[0]?.landType == 1" class="c-#666 f-s-28">地块信息:</text>
  23. <text v-if="+modeValue?.data?.[0]?.landType == 2" class="c-#666 f-s-28">圈舍信息:</text>
  24. <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#666 f-s-28">培养架信息:</text>
  25. <text class="c-#333 f-s-28 f-w-5">{{ modeValue?.data?.length }}个</text>
  26. <!-- <text v-if="modeValue?.aloneChecked" class="c-#333 f-s-28 f-w-5">该基地所有{{ +modeValue?.data?.[0]?.landType == 1 ? '地块' : +modeValue?.data?.[0]?.landType == 2 ? '圈舍' : '培养架' }}</text> -->
  27. </view>
  28. <view class="pt-8 pb-8" v-for="(item, index) in modeValue?.data" :key="index">
  29. <text class="c-#666 f-s-28 mr-20">{{ item?.landName }}:</text>
  30. <text v-if="+modeValue?.data?.[0]?.landType == 3" class="c-#333 f-s-28 f-w-5">{{ item?.capacityAmount }}{{ item?.capacityUnit }}</text>
  31. <text v-else class="c-#333 f-s-28 f-w-5">{{ item?.area }}{{ item?.areaUnit }}</text>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. // 定义props接口
  37. interface ModeValue {
  38. baseName?: string;
  39. area?: string | number;
  40. areaUnit?: string;
  41. address?: string;
  42. adcodeName?: string;
  43. gapFlag?: any;
  44. swyqRes?: any;
  45. aloneChecked?: boolean;
  46. data?: any[];
  47. // 保留原有字段以保持向后兼容
  48. checkBox?: any[];
  49. medicineName: string | null;
  50. swyqMedicineName: string | null;
  51. }
  52. // 接收modeValue对象
  53. const props = withDefaults(
  54. defineProps<{
  55. modeValue?: ModeValue;
  56. baseType: string;
  57. showClose?: boolean;
  58. }>(),
  59. {
  60. showClose: true,
  61. },
  62. );
  63. // 定义emit事件
  64. const emit = defineEmits<{
  65. (e: 'update:modeValue', value: ModeValue | null): void;
  66. (e: 'close'): void;
  67. }>();
  68. // 处理关闭
  69. const handleClose = () => {
  70. // 触发事件清空modeValue
  71. emit('update:modeValue', null);
  72. emit('close');
  73. };
  74. </script>
  75. <style scoped lang="scss">
  76. .label {
  77. font-size: 24rpx;
  78. color: #37a954;
  79. border-radius: 100rpx;
  80. background-color: #e3efe6;
  81. width: max-content;
  82. padding-left: 14rpx;
  83. padding-right: 14rpx;
  84. padding-top: 6rpx;
  85. padding-bottom: 6rpx;
  86. }
  87. </style>