<template>
    <div class="bigBox">
        <MOSTY.FromPage :title="'隐患清单详情'" @closeDialog="black">
            <template #content>
                <MOSTY.Assort :title="'基础信息'" />
                <el-form class="mosty-from-wrap" ref="ruleFormRef" label-width="130px" :model="fromObj" :inline="true"
                    :rules="rules" :disabled="true">
                    <el-form-item label="发现人名称:">
                        <el-input v-model="fromObj.founderName" style="width: 337px;" />
                    </el-form-item>
                    <el-form-item label="对象名称:">
                        <el-input v-model="fromObj.objname" style="width: 337px;" />
                    </el-form-item>
                    <el-form-item prop="pitfallType" label="隐患类型:">
                        <el-select v-model="fromObj.pitfallType" style="width: 337px;">
                            <el-option v-for="item in D_BZ_YHLX" :key="item.value" :label="item.label"
                                :value="item.value" />
                        </el-select>
                    </el-form-item>
                    <el-form-item prop="pitfallLevel" label="隐患级别:">
                        <el-select v-model="fromObj.pitfallLevel" style="width: 337px;">
                            <el-option v-for="item in D_DBZ_YHDJ" :key="item.value" :label="item.label"
                                :value="item.value" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="隐患描述:">
                        <el-input v-model="fromObj.pitfallDescribe" style="width: 337px;" />
                    </el-form-item>
                    <el-form-item label="隐患部位:">
                        <el-date-picker v-model="fromObj.partName" style="width: 337px" type="date"
                            value-format="YYYY-MM-DD" />
                    </el-form-item>
                </el-form>
            </template>
            <template #footer>
                <el-button @click="black"> <el-icon>
                        <DocumentDelete />
                    </el-icon>关闭</el-button>
            </template>
        </MOSTY.FromPage>
    </div>
</template>

<script setup>
import { ref, onMounted, getCurrentInstance } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
import { getApi } from "@/api/tobAcco_api.js";
const { proxy } = getCurrentInstance();
const { D_BZ_YHLX, D_DBZ_YHDJ } = proxy.$dict("D_BZ_YHLX", "D_DBZ_YHDJ");
const props = defineProps({
    id: {
        type: String,
        default: ''
    }
});

const fromObj = ref({})

const emit = defineEmits("saveSuccess");
const ruleFormRef = ref();
onMounted(() => {
    if (props.id) {
        getmain(props.id)
    }
});

//获取详情
function getmain(id) {
    if (id) {
        getApi({ id }, `/mosty-jcgl/yhb/getYhInfo`).then((res) => {
            if (res) {
                fromObj.value = res;
            }
        });
    }
}

const black = () => {
    emit("saveSuccess");
};

</script>

<style lang="scss" scoped>
.table-lable {
    margin: 10px;
    color: var(--el-color-primary);
}

::v-deep ::-webkit-scrollbar {
    display: none !important;
}

::v-deep .el-pagination {
    justify-content: center !important;
}


::v-deep .el-form {
    margin: auto;
    padding: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: start;
}

.el-form-item {
    display: flex;
    margin-right: 20px;
}

.bigBox {
    display: block !important;
    padding: 0 14px;
    box-sizing: border-box;
}




::v-deep .el-table .cell {
    padding: 0 0 !important;
}

::v-deep .el-table--border .el-table__cell .cell {
    padding-left: 0px !important;

    >input {
        width: 100%;
        height: 33px;
    }
}



::v-deep .el-upload-list {
    width: 50%;
}

::v-deep .el-form-item__content {
    margin-left: 0px !important;
}
</style>