Files
admin-sjzx/src/views/pqs/supervise/technology/detail.vue

118 lines
4.4 KiB
Vue
Raw Normal View History

2024-05-22 16:05:51 +08:00
<template>
2024-06-05 18:04:24 +08:00
<!--工作流view的路径/pqs/supervise/technology/detail-->
2024-06-14 10:26:35 +08:00
<div class="default-main">
2024-06-05 18:04:24 +08:00
<!-- <h1>详细信息回显</h1>-->
2024-06-14 10:26:35 +08:00
<el-descriptions :column="2" border>
<el-descriptions-item :label="detailData.leafletType == 1 ? '预警单名称' : '告警单名称'">
2024-06-05 18:04:24 +08:00
{{ detailData.leafletName }}
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<el-descriptions-item :label="detailData.leafletType == 1 ? '预警单' : '告警单' + '问题来源'">
2024-06-05 18:04:24 +08:00
{{ getProblemType(detailData.problemType) }}
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<el-descriptions-item :span="2" :label="detailData.leafletType == 1 ? '预警单' : '告警单' + '问题描述'">
2024-06-05 18:04:24 +08:00
{{ detailData.issueDetail }}
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<template v-if="detailData.problemType == 4">
<el-descriptions-item :span="2" label="附件">
2025-12-19 13:12:38 +08:00
<el-icon class="elView" v-if="detailData?.problemName && VITE_FLAG">
2024-06-14 10:26:35 +08:00
<View @click="openFile(detailData?.problemName)" />
2024-06-05 18:04:24 +08:00
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(detailData.keyName)" target="_blank">{{ detailData.problemName }}</span >
2024-06-05 18:04:24 +08:00
</el-descriptions-item>
</template>
2024-10-31 15:47:02 +08:00
<el-descriptions-item :span="2" label="整改意见">
{{ detailData.reformAdvice }}
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<el-descriptions-item :span="2" label="采取措施">
2024-06-05 18:04:24 +08:00
{{ detailData.takeStep }}
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<el-descriptions-item :span="2" label="处理成效报告">
2025-12-19 13:12:38 +08:00
<el-icon class="elView" v-if="detailData?.reportName && VITE_FLAG">
2024-06-14 10:26:35 +08:00
<View @click="openFile(detailData?.reportName)" />
2024-06-05 18:04:24 +08:00
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(detailData.keyName)" target="_blank">{{ detailData.reportName }}</span >
2024-06-05 18:04:24 +08:00
</el-descriptions-item>
</el-descriptions>
</div>
2024-05-22 16:05:51 +08:00
</template>
2024-06-14 10:26:35 +08:00
<script lang="ts" setup>
2024-05-22 16:05:51 +08:00
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { propTypes } from '@/utils/propTypes'
import { getById } from '@/api/supervision-boot/leaflet'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
import {download} from '@/utils/fileDownLoad'
2024-06-14 10:26:35 +08:00
import { Link, View } from '@element-plus/icons-vue'
2025-12-19 13:12:38 +08:00
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
2024-05-22 16:05:51 +08:00
defineOptions({ name: 'technology/detail' })
2024-06-06 22:14:20 +08:00
const openFile = (name: any) => {
2024-08-07 11:13:46 +08:00
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
2024-06-06 22:14:20 +08:00
}
2024-05-22 16:05:51 +08:00
const { query } = useRoute() // 查询参数
const props = defineProps({
2024-06-05 18:04:24 +08:00
id: propTypes.string.def(undefined)
2024-05-22 16:05:51 +08:00
})
const detailLoading = ref(false) // 表单的加载中
2024-06-14 10:26:35 +08:00
const detailData: any = ref({}) // 详情数据
const queryId = query.id // 从 URL 传递过来的 id 编号
2024-05-22 16:05:51 +08:00
const getProblemType = (type: number) => {
2024-06-05 18:04:24 +08:00
if (type === 1) {
return '技术监督计划'
}
if (type === 2) {
return '在线监测超标问题'
}
if (type === 3) {
return '用户投诉问题'
}
if (type === 4) {
return '试运行监测点问题'
2024-06-05 18:04:24 +08:00
}
return '试运行监测点问题'
2024-05-22 16:05:51 +08:00
}
/** 获得数据 */
const getInfo = async () => {
2024-06-05 18:04:24 +08:00
detailLoading.value = true
try {
await getById(props.id || queryId).then(res => {
detailData.value = res.data
getFileData()
})
} finally {
detailLoading.value = false
}
2024-05-22 16:05:51 +08:00
}
const getFileData = async () => {
2024-06-05 18:04:24 +08:00
//如果有问题附件
if (detailData.value.problemPath) {
await getFileNameAndFilePath({ filePath: detailData.value.problemPath }).then(res => {
detailData.value.keyName = res.data.name
2024-06-05 18:04:24 +08:00
detailData.value.problemPath = res.data.url
detailData.value.problemName = res.data.fileName
})
}
2024-05-22 16:05:51 +08:00
2024-06-05 18:04:24 +08:00
await getFileNameAndFilePath({ filePath: detailData.value.reportPath }).then(res => {
detailData.value.keyName = res.data.name
2024-06-05 18:04:24 +08:00
detailData.value.reportPath = res.data.url
detailData.value.reportName = res.data.fileName
})
2024-05-22 16:05:51 +08:00
}
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
/** 初始化 **/
onMounted(() => {
2024-06-05 18:04:24 +08:00
getInfo()
2024-05-22 16:05:51 +08:00
})
</script>
2024-06-14 10:26:35 +08:00
<style lang="scss" scoped>
.elView {
cursor: pointer;
2024-06-18 09:03:53 +08:00
margin-right: 10px;
2024-06-14 10:26:35 +08:00
}
</style>