<template>
     <div v-if="detailLoading" class="loading">
            <el-spin description="加载中..." />
        </div>
        <div v-else>
    <el-descriptions :column="2" border>
        <el-descriptions-item label="监测点名称">
            {{ detailData.lineName }}
        </el-descriptions-item>
        <el-descriptions-item label="调试原因">
            {{ detailData.reason }}
        </el-descriptions-item>
        <el-descriptions-item label="监测点编号">
            {{ detailData.lineId }}
        </el-descriptions-item>
        <el-descriptions-item label="终端编码">
            {{ detailData.monitoringTerminalCode }}
        </el-descriptions-item>
        <el-descriptions-item label="终端名称">
            {{ detailData.monitoringTerminalName }}
        </el-descriptions-item>
        <el-descriptions-item label="电网侧变电站">
            {{ detailData.powerSubstationName }}
        </el-descriptions-item>
    </el-descriptions>
    </div>
</template>
<script lang="ts" setup>
import { onMounted, ref, reactive } from 'vue'
import { useRoute } from 'vue-router'
import { propTypes } from '@/utils/propTypes'
import { getMointorPointTempLinedebugDetail } from '@/api/supervision-boot/jointDebugList/index'
defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数
const props = defineProps({
    id: propTypes.string.def(undefined)
})
const detailLoading = ref(false) // 表单的加载中
const detailData = ref<any>({}) // 详情数据
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号

/** 获得数据 */
const getInfo = async () => {
    detailLoading.value = true
    try {
        await getMointorPointTempLinedebugDetail({ id: props.id || queryId }).then(res => {
            detailData.value = res.data
        })
    } finally {
        detailLoading.value = false
    }
}
defineExpose({ open: getInfo }) // 提供 open 方法，用于打开弹窗

/** 初始化 **/
onMounted(() => {
    getInfo()
})
</script>
<style lang="scss">
.default-main {
    //   height: calc(100vh - 100px);
    overflow: auto;
}

::v-deep.el-icon svg {
    // margin: 5px !important;
    // position: absolute !important;
    // top: 20px !important;
}
.elView {
    cursor: pointer;
    margin-right: 10px;
}
</style>
