<!--
 * @Author: micky
 * @Date: 2024-09-10 21:16:57
 * @LastEditors: micky
 * @LastEditTime: 2024-10-28 17:25:10
 * @FilePath: \chargingpile-uniapp\src\bundle\pages\repair\repair-info-popup.vue
-->
<template>
    <u-popup :show="show" mode="bottom" @close="close" :closeable="true" :round="10">
        <view class="popup flex flex-col">
            <view class="title">维修信息</view>
            <view class="flex-1 overflow-auto min-h-[500rpx] max-h-[1300rpx]">
                <replacePartsReadonly
                    ref="partsListRef"
                    :itemList="repairList"
                    v-if="repairList?.length > 0"
                />
                <u-empty :iconSize="70" text="无更换配件" class="mt-6" v-else />
            </view>
        </view>
    </u-popup>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import replacePartsReadonly from './components/replace-parts-readonly.vue'
defineProps({
    repairList: {
        type: Array,
        default: () => []
    }
})
const show = ref(false)

const close = () => {
    show.value = false
}
const showPopup = () => {
    show.value = true
}
defineExpose({
    showPopup
})
</script>

<style lang="scss" scoped>
.popup {
    @include flex-direction;
    max-height: 700rpx;
    padding: 0 20px 30px;
    .title {
        @include flex-center;
        padding: 15px 0;
        font-weight: 500;
        font-size: 32rpx;
    }
}
</style>
