<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="排查项内容：" prop="itemName">
                        <el-input v-model="fromObj.itemName" type="textarea" autosize style="width: 1311px;" />
                    </el-form-item>
                    <el-form-item prop="yhNote" label="隐患说明：">
                        <el-input v-model="fromObj.yhNote" type="textarea" autosize style="width: 1311px;" />
                    </el-form-item>
                    <el-form-item prop="yhLv" label="隐患等级：">
                        <el-select v-model="fromObj.yhLv" style="width: 337px;" placeholder="请选择隐患等级">
                            <el-option v-for="item in props.dict.D_DBZ_YHDJ" :key="item.value" :label="item.label"
                                :value="item.value" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="检查时间:" prop="addTime">
                        <el-date-picker v-model="fromObj.addTime" style="width: 337px" type="date"
                            value-format="YYYY-MM-DD" />
                    </el-form-item>
                    <el-form-item prop="yhFlag" label="标红项：">
                        <el-select v-model="fromObj.yhFlag" style="width: 337px;" placeholder="请选择标红项">
                            <el-option v-for="item in props.dict.NYHBZ" :key="item.value" :label="item.label"
                                :value="item.value" />
                        </el-select>
                    </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 } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
import { getApi } from "@/api/tobAcco_api.js";
const props = defineProps({
    id: {
        type: String,
        default: ''
    },
    dict: {
        type: Object,
        default: {}
    }
});

const fromObj = ref({})

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

//获取详情
function getmain(id) {
    if (id) {
        getApi({}, `/mosty-jcgl/checklibitem/getChecklibitemById/${id}`).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>