<template>
    <div>
        <div class="basic-info-title">
            <img src="@/assets/enterpriseLibrary/basic-info.png" alt="基础信息">
            <span>基础信息</span>
        </div>
        <div class="detail-content">
            <el-row :gutter="24">
                <el-col :span="8">
                    <DetailItem label="电压等级" :value="form.voltageLevel" />
                </el-col>
                <el-col :span="8">
                    <DetailItem label="建设性质" :value="form.natureConstruction" />
                </el-col>
                <el-col :span="8">
                    <DetailItem label="结构形式" :value="form.structuralForm" />
                </el-col>

            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <DetailItem label="基础形式" :value="form.basicForm" />
                </el-col>
            </el-row>
        </div>
    </div>
</template>

<script>
import DetailItem from '@/views/common/DetailItem.vue';
export default {
    name: 'BasicInfoDetailTechnical',
    components: {
        DetailItem
    },
    props: {
        detailData: {
            type: Object,
            default: () => { }
        }
    },
    data() {
        return {
            form: {
                voltageLevel: undefined,
                natureConstruction: undefined,
                structuralForm: undefined,
                basicForm: undefined,
            },
        }
    },
    watch: {
        detailData: {
            handler(newVal) {
                if (Object.keys(newVal).length > 0) {
                    this.setDetailData(newVal)
                }
            },
            immediate: true
        }
    },
    created() {
    },
    methods: {
        setDetailData() {
            this.form = {
                voltageLevel: this.detailData.voltageLevel || '',
                natureConstruction: this.detailData.natureConstruction || '',
                structuralForm: this.detailData.structuralForm || '',
                basicForm: this.detailData.basicForm || '',
            }
        },
    },

}
</script>

<style scoped lang="scss">
.basic-info-title {
    display: flex;
    align-items: center;
    margin: 10px 0;

    span {
        margin: 0 5px;
        font-size: 20px;
    }
}

.form-item {
    width: 100%;
}
</style>